I would like git diff
to compare only within a regex. For example:
Contents of file at Revision A:
A 0 1
A 1 1 2
A 0 1 2 3
A 1 1 2 3 4
Contents of file at Revision B:
B 0 1
B 0 1 2
B 1 1 2 4
B 1 1 2 4 8 16
I might want to ignore the first word (ie 'A' or 'B'), match the next two words, and ignore the rest of the line. In the above, only the second and third lines should be reported.
How to grep the git diff? indicates that git -G
used to do what I want but it's behavior has changed. Is there a way to get this to happen (short of doing something like diff <(git show ... | awk ...) <(git show ... | awk ...)
)?