gitgit-diffbeyondcompare4

Compare diff of multiple files in a single compre window


I've made a simple regex find & replace in my project which affected ~300 files, mostly in 2-5 lines per file. In addition there were some minor tweaks and manual changes to fix irregular case.

Now I want to see all diff and compare each change using some compare tool (preferably beyond compare 4).

The best I came up with was to use git diff > changes.diff but this is still a single document and I prefer to see it side by side.

Is there a way to view all diffs in a single compare window?

P.S I could probably parse the diff file and take the + lines to one file and - lines to another, but hopefully there's something automatic for me to use.

EDIT:

I'm not looking for a way to compare diff using a tool like Beyond Compare. I want to view all changes from multiple file at once as side by side comparison. I don't want to go over the 300+ files one by one and compare using BC, instead I want to open a single file which contains all changes and compare it to the same file without the changes.

For example, if I have 2 files test1.cpp and test2.cpp and I do git diff I'll get:

diff --git.....
--- a/file1.cpp
+++ b/file1.cpp
@@ ....
- foo("a", "b");
+ bar("a", "b");

--- a/file2.cpp
+++ b/file2.cpp
@@ ....
- foo("x", "y");
+ bar("x", "y");

I want to be able to open BC and see something like (in a single tab/window):

--- a/file1.cpp     |    +++ b/file1.cpp
foo("a", "b");      |    bar("a", "b");
                    | 
--- a/file2.cpp     |    +++ b/file2.cpp
foo("x", "y");      |    bar("x", "y");

Solution

  • To output all file differences to a single file using Beyond Compare:

    1. Run Beyond Compare.
    2. Open the Folder Compare and load a pair of folders.
    3. Select the files you want to compare.
    4. Actions > File Compare Report.
    5. Select Side-by-side as the report layout.
    6. Set Output options to HTML report or Plain text.

    To cycle through differences one file at a time:

    1. Run Beyond Compare.
    2. Open the Folder Compare.
    3. Load a pair of folders.
    4. Double click on the first pair of files in the Folder Compare to display their contents in the Text Compare.
    5. Use Search > Next Difference (Control+N) to cycle through differences within the current file.
    6. Use Search > Next Difference File (Control+M) to cycle to the next file.