aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-08-21 13:56:52 -0700
committerJunio C Hamano <junkio@cox.net>2005-08-22 18:32:38 -0700
commit792fe559d02e55c12d2d544fd6d6f202cbaab6f4 (patch)
treeb3d713761c63768d5440180692c45f7fd508516e
parent56fc5108a2e82a5780179f05a46d3b8be507dc8c (diff)
downloadgit-792fe559d02e55c12d2d544fd6d6f202cbaab6f4.tar.gz
git-792fe559d02e55c12d2d544fd6d6f202cbaab6f4.tar.xz
Fix "git-diff-script A B"
When "git-diff-script A..B" notation was introduced, it ended up breaking the traditional two revisions notation. [jc: there are other issues with the current "git diff" I would like to address, but they would be left to later rounds. For example, -M and -p flags should not be hardcoded default, and it shouldn't be too hard to rewrite the script without using shell arrays.] Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-diff-script10
1 files changed, 8 insertions, 2 deletions
diff --git a/git-diff-script b/git-diff-script
index 926f594be..99ff2640f 100755
--- a/git-diff-script
+++ b/git-diff-script
@@ -8,8 +8,14 @@ case "${#rev[*]}" in
1)
git-diff-cache -M -p "$@";;
2)
- begin=$(echo "${rev[1]}" | tr -d '^')
- end="${rev[0]}"
+ case "${rev[1]}" in
+ ^?*)
+ begin=$(echo "${rev[1]}" | tr -d '^')
+ end="${rev[0]}" ;;
+ *)
+ begin="${rev[0]}"
+ end="${rev[1]}" ;;
+ esac
git-diff-tree -M -p $flags $begin $end $files;;
*)
echo "I don't understand"