Are there any tools that can perform given operations (union, intersection, difference, etc.) on diff?
For example, if I have two differences that overlap (that is, they contain hunks with the same changes), I would like to be able to do things like “get all the pieces that are only in one decomposition” or “get all hunks” which are common to both differences. "
For example, given the two differences Aand B:
$ cat A.diff
@@ ... @@
+ foo
- bar
@@ ... @@
+ baz
$ cat B.diff
@@ ... @@
+ foo
- bar
@@ ... @@
+ bam
One of the things I would like to see is:
$ diff_symetric_difference A.diff B.diff
@@ ... @@
+ baz
@@ ... @@
+ bam
$ diff_subtract A.diff B.diff
@@ ... @@
+ baz
, (, diffs A C, A..D - A - C).