]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-diff.sh
show-branch: make the current branch and merge commits stand out.
[thirdparty/git.git] / git-diff.sh
index 7baf7044e440e6d052f5e92e1008f710dd319c67..4812ae4c1ff937ded49334a97ee1dc2c1732e433 100755 (executable)
@@ -3,6 +3,10 @@
 # Copyright (c) 2005 Linus Torvalds
 # Copyright (c) 2005 Junio C Hamano
 
+USAGE='[ --diff-options ] <ent>{0,2} [<path>...]'
+SUBDIRECTORY_OK='Yes'
+. git-sh-setup
+
 rev=$(git-rev-parse --revs-only --no-flags --sq "$@") || exit
 flags=$(git-rev-parse --no-revs --flags --sq "$@")
 files=$(git-rev-parse --no-revs --no-flags --sq "$@")
@@ -35,8 +39,7 @@ esac
 
 case "$rev" in
 ?*' '?*' '?*)
-       echo >&2 "I don't understand"
-       exit 1
+       usage
        ;;
 ?*' '^?*)
        begin=$(expr "$rev" : '.*^.\([0-9a-f]*\).*') &&
@@ -53,7 +56,7 @@ case "$rev" in
        cmd="git-diff-files $flags -- $files"
        ;;
 *)
-       die "I don't understand $*"
+       usage
        ;;
 esac