Created
November 25, 2015 11:26
-
-
Save x3ro/96d582273e32abbdc690 to your computer and use it in GitHub Desktop.
Script which shows other commits that touch a file introduced by the given commit
This file contains 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
# Didn't find a good name for this yet :D | |
function git-foobar { | |
COMMITS=$(git diff-tree --no-commit-id --name-only -r --diff-filter=A $1 | \ | |
xargs git log --pretty="%H" -- | \ | |
uniq | \ | |
grep --invert-match $(git rev-parse $1)) | |
if (( $(echo -n "$COMMITS" | wc -l) > 0 )); then | |
echo "$COMMITS" | xargs git show --stat | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment