Skip to content

Instantly share code, notes, and snippets.

@chrishunt
Last active December 17, 2015 22:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrishunt/5685262 to your computer and use it in GitHub Desktop.
Save chrishunt/5685262 to your computer and use it in GitHub Desktop.
Show commits with a 1 char diff
# Find all SHAS with a single line diff
SHAS=`git log --stat --oneline |\
grep "| 2 +-" -B1 |\
egrep -v "^(\s|-)" |\
cut -d' ' -f1`
# Of those SHAS, find the ones with single character diff
git show --word-diff=plain -p --oneline `echo $SHAS` |\
egrep "(\[-|{\+).(\+}|-\])" -B10 |\
grep "$SHAS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment