Skip to content

Commit

Permalink
git-diff: Usage string clean-up
Browse files Browse the repository at this point in the history
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Fredrik Kuivinen authored and Junio C Hamano committed Dec 16, 2005
1 parent c6f60f9 commit 92811b5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions git-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
# 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 "$@")

die () {
echo >&2 "$*"
exit 1
}

# I often say 'git diff --cached -p' and get scolded by git-diff-files, but
# obviously I mean 'git diff --cached -p HEAD' in that case.
case "$rev" in
Expand Down Expand Up @@ -40,8 +39,7 @@ esac

case "$rev" in
?*' '?*' '?*)
echo >&2 "I don't understand"
exit 1
usage
;;
?*' '^?*)
begin=$(expr "$rev" : '.*^.\([0-9a-f]*\).*') &&
Expand All @@ -58,7 +56,7 @@ case "$rev" in
cmd="git-diff-files $flags -- $files"
;;
*)
die "I don't understand $*"
usage
;;
esac

Expand Down

0 comments on commit 92811b5

Please sign in to comment.