Created
March 20, 2011 17:13
-
-
Save sbellware/878463 to your computer and use it in GitHub Desktop.
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
function changes { | |
start="$1" | |
end="$2" | |
if [ -z "$2" ]; then | |
start="$1"^ | |
end="$1" | |
fi | |
if [ -z "$1" ]; then | |
start=HEAD^ | |
end=HEAD | |
fi | |
git diff --name-only $start..$end | sort | uniq | |
} |
For future reference I recommend the Advance Bash Scripting Guide - PDF / HTML versions at http://tldp.org/guides.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I came to the conclusion that your if-then logic is readable relative to any fancy shell parameter expansion I can come up with (which I gave up on). I think you have what you need to figure it out now.