Git development
 help / color / mirror / Atom feed
From: Fredrik Kuivinen <freku045@student.liu.se>
To: git@vger.kernel.org
Cc: junkio@cox.net
Subject: [PATCH 1/3] git-diff: Usage string clean-up
Date: Thu, 15 Dec 2005 23:47:57 +0100	[thread overview]
Message-ID: <20051215224757.GC14388@c165.ib.student.liu.se> (raw)
In-Reply-To: <20051215224350.GB14388@c165.ib.student.liu.se>

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>


---

 git-diff.sh |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

ca73d87d08c8c3702495694cc1080112c4c34ba1
diff --git a/git-diff.sh b/git-diff.sh
index b62e583..4812ae4 100755
--- a/git-diff.sh
+++ b/git-diff.sh
@@ -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
@@ -40,8 +39,7 @@ esac
 
 case "$rev" in
 ?*' '?*' '?*)
-	echo >&2 "I don't understand"
-	exit 1
+	usage
 	;;
 ?*' '^?*)
 	begin=$(expr "$rev" : '.*^.\([0-9a-f]*\).*') &&
@@ -58,7 +56,7 @@ case "$rev" in
 	cmd="git-diff-files $flags -- $files"
 	;;
 *)
-	die "I don't understand $*"
+	usage
 	;;
 esac
 
-- 
0.99.9.GIT

  reply	other threads:[~2005-12-15 22:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-15 22:43 [PATCH 0/3] Usage string clean-up (diff, log and whatchanged) Fredrik Kuivinen
2005-12-15 22:47 ` Fredrik Kuivinen [this message]
2005-12-15 22:48 ` [PATCH 2/3] git-log: Add usage string Fredrik Kuivinen
2005-12-15 22:48 ` [PATCH 3/3] git-whatchanged: " Fredrik Kuivinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051215224757.GC14388@c165.ib.student.liu.se \
    --to=freku045@student.liu.se \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox