Zeigen Sie Diffs in einer "unified Diff"-Datei nebeneinander an

Wenn ich viele kleine Änderungen in mehreren Dateien in einem Suversion-Quellordner habe, ist es praktisch, die Änderungen über eine große einheitliche Diff- Datei zu betrachten. Um es klar zu sagen, eine einheitliche Diff- Datei, wie sie von Subversion erstellt wird, sieht so aus (Beispiel enthält die Diffs aus zwei Dateien, die Diffs erscheinen alle in derselben .diff-Datei):

Index: file1.py
===================================================================
--- file1.py    (revision 2)
+++ file1.py    (working copy)
@@ -227,7 +229,7 @@
         some line of code
         some other line of code
         yet a third line of code
-        first change, left
+        first change, right
         some line of code
         some other line of code
         yet a third line of code
@@ -608,8 +610,8 @@
         some line of code
         some other line of code
         yet a third line of code
-##         second change, left
-##         third change, left
+        second change, right
+        third change, right
         some line of code
         some other line of code
         yet a third line of code
\ No newline at end of file
Index: file2.py
===================================================================
--- file2.py    (revision 3)
+++ file2.py    (working copy)
@@ -3607,22 +3630,22 @@
         some line of code
         some other line of code
         yet a third line of code
-##         first change, left
-##         second change, left
+        first change, right
+        second change, right
         some line of code
         some other line of code
         yet a third line of code
@@ -7988,7 +8011,7 @@
         some line of code
         some other line of code
         yet a third line of code
-        third change, left
+        third change, right
         some line of code
         some other line of code
         yet a third line of code

Wie Sie sich vorstellen können, ist es sehr praktisch, wenn es viele ähnliche Änderungen in mehreren Dateien gibt, diese in tortoiseudiff (beachten Sie das "u" im Namen) anzusehen, da die Änderungen farblich gekennzeichnet sind und Sie sie schnell scannen können. tortoiseudiff zeigt diese Datei jedoch so an, wie sie ist (plus einige Syntaxhervorhebungen): Die "linke" und "rechte" Seite des Diffs sind vertikal und nicht nebeneinander angeordnet. Es wäre sogar noch besser, die beiden Seiten jedes Diff-Blocks nebeneinander zu sehen, anstatt oben/unten. Etwas wie das:

Index: file1.py
===================================================================
--- file1.py    (revision 2)
+++ file1.py    (working copy)
@@ -227,7 +229,7 @@
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
-   first change, left                 +   first change, right
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
@@ -608,8 +610,8 @@
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
-##         second change, left
-##         third change, left
+        second change, right
+        third change, right
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
\ No newline at end of file
Index: file2.py
===================================================================
--- file2.py    (revision 3)
+++ file2.py    (working copy)
@@ -3607,22 +3630,22 @@
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
-##   first change, left             +     first change, right
-##   second change, left            +     second change, right
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
@@ -7988,7 +8011,7 @@
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
-   third change, left                 +   third change, right
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code

oder noch besser das:

Index: file1.py
===================================================================
--- file1.py    (revision 2)
+++ file1.py    (working copy)
@@ -227,7 +229,7 @@
                     some line of code
                     some other line of code
                     yet a third line of code
-        first change, left             +        first change, right
                     some line of code
                     some other line of code
                     yet a third line of code
@@ -608,8 +610,8 @@
                     some line of code
                     some other line of code
                     yet a third line of code
-##         second change, left         +        second change, right
-##         third change, left          +        third change, right
                     some line of code
                     some other line of code
                     yet a third line of code
\ No newline at end of file
Index: file2.py
===================================================================
--- file2.py    (revision 3)
+++ file2.py    (working copy)
@@ -3607,22 +3630,22 @@
                     some line of code
                     some other line of code
                     yet a third line of code
-##         first change, left          +        first change, right
-##         second change, left         +        second change, right
                     some line of code
                     some other line of code
                     yet a third line of code
@@ -7988,7 +8011,7 @@
                     some line of code
                     some other line of code
                     yet a third line of code
-        third change, left             +        third change, right
                     some line of code
                     some other line of code
                     yet a third line of code

Ich bin auf MS Windows, also habe ich mir Winmerge, Tortoiseudiff, Tortoiseidff angesehen, keiner unterstützt dies. Ich habe im Internet nach anderen Optionen gesucht, aber kein Glück.

Kennt jemand ein Tool, das das kann?

Antworten (1)

Ich denke, Beyond Compare erfüllt Ihre Bedürfnisse. Die Ordnervergleichsfunktion zeigt, welche Dateien sich zwischen zwei Ordnersätzen unterscheiden, und Sie können dann alle Dateien auswählen und einen Bericht über Dateiunterschiede erstellen, was meiner Meinung nach das ist, was Sie wollen. An einem einfachen Beispiel sieht die GUI so aus:

Beyond Compare Ordnervergleich

und der Bericht sieht so aus:

FILE COMPARISON
Produced: 15/05/2014 12:27:16

Mode:  All Lines
Left base folder: C:\Example
Right base folder: C:\Example2

File: Subfolder\File3.txt
1 Test         =  1 Test
2 Another test    2 Another test
----------------------------------------------
               -+ 3 Extra line
----------------------------------------------
3 More testing =  4 More testing
----------------------------------------------

File: File1.txt
1 Test         <> 1 Deleted line
                  2 Another modified line test
2 Another test    3 Extra line
----------------------------------------------
3 More testing =  4 More testing
----------------------------------------------

File: File2.txt
1 Test         =  1 Test
2 Another test    2 Another test
3 More testing    3 More testing
----------------------------------------------

In diesem Beispiel habe ich alle Zeilen angezeigt, auch wenn sie gleich sind, aber es ist möglich, zu filtern, um nur die geänderten Zeilen anzuzeigen, wenn Sie möchten. Es gibt auch eine Skriptschnittstelle, wenn Sie nicht durch die GUI gehen möchten, und eine kostenlose 30-Tage-Testversion.