Last active
September 13, 2018 09:26
-
-
Save Deadlyelder/37c4e1682f61e8bf0809b3e07acc97f8 to your computer and use it in GitHub Desktop.
Dirty script to get diff in more systematic manner (without noise) for AST
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git diff <hash-commit-1>:<fillename> <hash-commit-1>:<filename> | gawk 'match($0,"^@@ -([0-9]+),[0-9]+ [+]([0-9]+),[0-9]+ @@",a){left=a[1];right=a[2];next} | |
/^(---|\+\+\+|[^-+ ])/{print;next};\ | |
{line=substr($0,2)};\ | |
/^-/{print "-" left++ ":" line;next};\ | |
/^[+]/{print "+" right++ ":" line;next};\ | |
{print "(" left++ "," right++ "):"line}' | grep -v '^+++' | grep -v '^---' | grep -v 'diff' | grep -v 'index' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment