Last active
December 17, 2015 22:39
-
-
Save aprescott/5683945 to your computer and use it in GitHub Desktop.
An attempt at showing only git commits where a single character has been changed.
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
# an attempt at showing only commits where a single character has been changed. | |
# | |
# lots of false positives. | |
git rev-list --all --no-merges | | |
while read commit; do | |
files_changed=$(git diff $commit^ $commit --name-only | wc -l) | |
diffcontent="$(git diff --numstat --minimal -U0 --word-diff=porcelain --word-diff-regex=. $commit^ $commit | grep -e '^\+.$')" | |
if [ $files_changed -eq 1 ] && [ $(echo "$diffcontent" | wc -l) -eq 1 ] && [ ! -z "$diffcontent" ]; then | |
echo $commit | |
echo "$(git diff --minimal $commit^ $commit)" | |
echo ----- | |
fi; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment