Created
November 10, 2011 14:52
-
-
Save xaptronic/1355024 to your computer and use it in GitHub Desktop.
Get names of files changed in the latest 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
die () { | |
echo >&2 "$@" | |
exit 1 | |
} | |
HOW_FAR=1 | |
[ "$#" -eq 0 ] || HOW_FAR=$1 | |
echo $HOW_FAR | grep -E -q '^[0-9]+$' || die "need to pass a number if you gonna pass" | |
git log -n$HOW_FAR --oneline | cut -f1 -d' ' | xargs -I% git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT % | sort | uniq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment