Trivial usage string clean-up
authorfreku045@student.liu.se <freku045@student.liu.se>
Tue, 13 Dec 2005 22:30:31 +0000 (23:30 +0100)
committerJunio C Hamano <junkio@cox.net>
Wed, 14 Dec 2005 10:53:43 +0000 (02:53 -0800)
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
14 files changed:
git-add.sh
git-applymbox.sh
git-checkout.sh
git-clone.sh
git-commit.sh
git-format-patch.sh
git-grep.sh
git-merge.sh
git-pull.sh
git-push.sh
git-request-pull.sh
git-reset.sh
git-resolve.sh
git-tag.sh
index fdec86d1a41af847f9d737a2c058e2d2027f32fe..f719b4b1a81a386c9cf62efad811005471be0f8c 100755 (executable)
@@ -1,13 +1,8 @@
 #!/bin/sh
 
 #!/bin/sh
 
-die () {
-    echo >&2 "$*"
-    exit 1
-}
-
-usage() {
-    die "usage: git add [-n] [-v] <file>..."
-}
+USAGE='[-n] [-v] <file>...'
+SUBDIRECTORY_OK='Yes'
+. git-sh-setup
 
 show_only=
 verbose=
 
 show_only=
 verbose=
@@ -29,8 +24,6 @@ while : ; do
   shift
 done
 
   shift
 done
 
-GIT_DIR=$(git-rev-parse --git-dir) || exit
-
 if test -f "$GIT_DIR/info/exclude"
 then
        git-ls-files -z \
 if test -f "$GIT_DIR/info/exclude"
 then
        git-ls-files -z \
index c686cc8d27a64998c141cca2989375910601f90f..61c8c024c60935b4766b5052461b4c73918a69ec 100755 (executable)
 ##
 ## git-am is supposed to be the newer and better tool for this job.
 
 ##
 ## git-am is supposed to be the newer and better tool for this job.
 
+USAGE='[-u] [-k] [-q] [-m] (-c .dotest/<num> | mbox) [signoff]'
 . git-sh-setup
 
 . git-sh-setup
 
-usage () {
-    echo >&2 "applymbox [-u] [-k] [-q] [-m] (-c .dotest/<num> | mbox) [signoff]"
-    exit 1
-}
-
 keep_subject= query_apply= continue= utf8= resume=t
 while case "$#" in 0) break ;; esac
 do
 keep_subject= query_apply= continue= utf8= resume=t
 while case "$#" in 0) break ;; esac
 do
index 4cf30e2c0529e90886e6edfd485cec67a278e224..f241d4ba6ba5a988f801e3307022d188204ff572 100755 (executable)
@@ -1,9 +1,7 @@
 #!/bin/sh
 #!/bin/sh
-. git-sh-setup
 
 
-usage () {
-    die "usage: git checkout [-f] [-b <new_branch>] [<branch>] [<paths>...]"
-}
+USAGE='[-f] [-b <new_branch>] [<branch>] [<paths>...]'
+. git-sh-setup
 
 old=$(git-rev-parse HEAD)
 new=
 
 old=$(git-rev-parse HEAD)
 new=
index e49028f684ffe2fd50012759f54475f0db7b4d68..280cc2e81e98c5fe69e8528ca97069dd0b0e59f5 100755 (executable)
@@ -9,7 +9,7 @@
 unset CDPATH
 
 usage() {
 unset CDPATH
 
 usage() {
-       echo >&2 "* git clone [-l [-s]] [-q] [-u <upload-pack>] [-n] <repo> [<dir>]"
+       echo >&2 "Usage: $0 [-l [-s]] [-q] [-u <upload-pack>] [-n] <repo> [<dir>]"
        exit 1
 }
 
        exit 1
 }
 
index 3d250ec853dad3ff7e714025026ca90f2c77e7bb..7e39c107cff93f601c51fec6544a0defe9814db1 100755 (executable)
@@ -3,12 +3,9 @@
 # Copyright (c) 2005 Linus Torvalds
 #
 
 # Copyright (c) 2005 Linus Torvalds
 #
 
+USAGE='[-a] [-s] [-v | --no-verify]  [-m <message> | -F <logfile> | (-C|-c) <commit>] [-e] [<path>...]'
 . git-sh-setup
 
 . git-sh-setup
 
-usage () {
-       die 'git commit [-a] [-s] [-v | --no-verify]  [-m <message> | -F <logfile> | (-C|-c) <commit>] [-e] [<path>...]'
-}
-
 all= logfile= use_commit= no_edit= log_given= log_message= verify=t signoff=
 while case "$#" in 0) break;; esac
 do
 all= logfile= use_commit= no_edit= log_given= log_message= verify=t signoff=
 while case "$#" in 0) break;; esac
 do
index 921feee59cd7e770328fc1d167e01730a238489e..01508e3b04f91bba3e960eb74eaff3e349e209bd 100755 (executable)
@@ -3,19 +3,8 @@
 # Copyright (c) 2005 Junio C Hamano
 #
 
 # Copyright (c) 2005 Junio C Hamano
 #
 
-. git-sh-setup
-
-# Force diff to run in C locale.
-LANG=C LC_ALL=C
-export LANG LC_ALL
-
-usage () {
-    echo >&2 "usage: $0"' [-n] [-o dir | --stdout] [--keep-subject] [--mbox]
-    [--check] [--signoff] [-<diff options>...]
-    [--help]
-    ( from..to ... | upstream [ our-head ] )
-
-Prepare each commit with its patch since our-head forked from upstream,
+USAGE='[-n | -k] [-o <dir> | --stdout] [--signoff] [--check] [--mbox] [--diff-options] <upstream> [<our-head>]'
+LONG_USAGE='Prepare each commit with its patch since our-head forked from upstream,
 one file per patch, for e-mail submission.  Each output file is
 numbered sequentially from 1, and uses the first line of the commit
 message (massaged for pathname safety) as the filename.
 one file per patch, for e-mail submission.  Each output file is
 numbered sequentially from 1, and uses the first line of the commit
 message (massaged for pathname safety) as the filename.
@@ -28,10 +17,12 @@ as "[PATCH N/M] Subject", unless you have only one patch.
 
 When --mbox is specified, the output is formatted to resemble
 UNIX mailbox format, and can be concatenated together for processing
 
 When --mbox is specified, the output is formatted to resemble
 UNIX mailbox format, and can be concatenated together for processing
-with applymbox.
-'
-    exit 1
-}
+with applymbox.'
+. git-sh-setup
+
+# Force diff to run in C locale.
+LANG=C LC_ALL=C
+export LANG LC_ALL
 
 diff_opts=
 LF='
 
 diff_opts=
 LF='
index 44c16130bd93fea8b6f172f1614115801f8df2d9..2ed8e955d6c44da7bd15342aac64de997f0f4bf4 100755 (executable)
@@ -3,6 +3,10 @@
 # Copyright (c) Linus Torvalds, 2005
 #
 
 # Copyright (c) Linus Torvalds, 2005
 #
 
+USAGE='<option>... <pattern> <path>...'
+SUBDIRECTORY_OK='Yes'
+. git-sh-setup
+
 pattern=
 flags=()
 git_flags=()
 pattern=
 flags=()
 git_flags=()
@@ -40,8 +44,7 @@ while : ; do
        shift
 done
 [ "$pattern" ] || {
        shift
 done
 [ "$pattern" ] || {
-       echo >&2 "usage: 'git grep <pattern> [pathspec*]'"
-       exit 1
+       usage
 }
 git-ls-files -z "${git_flags[@]}" "$@" |
        xargs -0 grep "${flags[@]}" -e "$pattern"
 }
 git-ls-files -z "${git_flags[@]}" "$@" |
        xargs -0 grep "${flags[@]}" -e "$pattern"
index d25ae4b82d4208216bb7ce5b5d414ee8b2797865..e50fbb1160ad6ccfebc0d65fcc54bc3488e597cd 100755 (executable)
@@ -3,15 +3,13 @@
 # Copyright (c) 2005 Junio C Hamano
 #
 
 # Copyright (c) 2005 Junio C Hamano
 #
 
+
+USAGE='[-n] [--no-commit] [-s <strategy>]... <merge-message> <head> <remote>+'
 . git-sh-setup
 
 LF='
 '
 
 . git-sh-setup
 
 LF='
 '
 
-usage () {
-    die "git-merge [-n] [--no-commit] [-s <strategy>]... <merge-message> <head> <remote>+"
-}
-
 all_strategies='recursive octopus resolve stupid ours'
 default_strategies='recursive'
 use_strategies=
 all_strategies='recursive octopus resolve stupid ours'
 default_strategies='recursive'
 use_strategies=
index 3a139849fbfc545b7c479dd2889a0285fab646d5..0991d5f14cd6d903572a041cfbfe3cde219c738f 100755 (executable)
@@ -4,19 +4,10 @@
 #
 # Fetch one or more remote refs and merge it/them into the current HEAD.
 
 #
 # Fetch one or more remote refs and merge it/them into the current HEAD.
 
+USAGE='[-n | --no-summary] [--no-commit] [-s strategy]... [<fetch-options>] <repo> <head>...'
+LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.'
 . git-sh-setup
 
 . git-sh-setup
 
-usage () {
-    echo >&2 "usage: $0"' [-n] [--no-commit] [--no-summary] [--help]
-    [-s strategy]...
-    [<fetch-options>]
-    <repo> <head>...
-
-Fetch one or more remote refs and merge it/them into the current HEAD.
-'
-    exit 1
-}
-
 strategy_args= no_summary= no_commit=
 while case "$#,$1" in 0) break ;; *,-*) ;; *) break ;; esac
 do
 strategy_args= no_summary= no_commit=
 while case "$#,$1" in 0) break ;; *,-*) ;; *) break ;; esac
 do
index 140c8f85d55c5654cfc9077fecfd03ad067a6862..1c5cf80f8786eb20c6092a8fbce48e1f1c1cb9e1 100755 (executable)
@@ -1,10 +1,7 @@
 #!/bin/sh
 #!/bin/sh
-. git-sh-setup
-
-usage () {
-    die "Usage: git push [--all] [--force] <repository> [<refspec>]"
-}
 
 
+USAGE='[--all] [--force] <repository> [<refspec>...]'
+. git-sh-setup
 
 # Parse out parameters and then stop at remote, so that we can
 # translate it using .git/branches information
 
 # Parse out parameters and then stop at remote, so that we can
 # translate it using .git/branches information
index ae6cd272bab01ba7fa9ac7378fe33e07e853d307..2c48bfb299325ba7a27e883b6a4815ebde09ae58 100755 (executable)
@@ -4,13 +4,11 @@
 # This file is licensed under the GPL v2, or a later version
 # at the discretion of Linus Torvalds.
 
 # This file is licensed under the GPL v2, or a later version
 # at the discretion of Linus Torvalds.
 
-usage()
-{
-       echo "$0 <commit> <url> [ <head> ]"
-       echo "  Summarizes the changes since <commit> to the standard output,"
-       echo "  and includes <url> in the message generated."
-       exit 1
-}
+USAGE='<commit> <url> [<head>]'
+LONG_USAGE='Summarizes the changes since <commit> to the standard output,
+and includes <url> in the message generated.'
+SUBDIRECTORY_OK='Yes'
+. git-sh-setup
 
 revision=$1
 url=$2
 
 revision=$1
 url=$2
index 72ef303aedc69a1d9cdd946a91059638cb2e550a..eb44ee8cc197b7ff11159cf046b790cf693d3a72 100755 (executable)
@@ -1,9 +1,7 @@
 #!/bin/sh
 #!/bin/sh
-. git-sh-setup
 
 
-usage () {
-       die 'Usage: git reset [--mixed | --soft | --hard]  [<commit-ish>]'
-}
+USAGE='[--mixed | --soft | --hard]  [<commit-ish>]'
+. git-sh-setup
 
 tmp=/var/tmp/reset.$$
 trap 'rm -f $tmp-*' 0 1 2 3 15
 
 tmp=/var/tmp/reset.$$
 trap 'rm -f $tmp-*' 0 1 2 3 15
index fcc5ad7349e3f77a6817e499b331b262c4a07b57..926307005493b7c8c4253b1adff34bdb4bc57b77 100755 (executable)
@@ -4,11 +4,9 @@
 #
 # Resolve two trees.
 #
 #
 # Resolve two trees.
 #
-. git-sh-setup
 
 
-usage () {
-       die "git-resolve <head> <remote> <merge-message>"
-}
+USAGE='<head> <remote> <merge-message>'
+. git-sh-setup
 
 dropheads() {
        rm -f -- "$GIT_DIR/MERGE_HEAD" \
 
 dropheads() {
        rm -f -- "$GIT_DIR/MERGE_HEAD" \
index 2435a75f7a9414bdceb1cef308a99918784f5421..6d0c973239a1b72bbef43aa430f1ee534b7ab458 100755 (executable)
@@ -1,17 +1,9 @@
 #!/bin/sh
 # Copyright (c) 2005 Linus Torvalds
 
 #!/bin/sh
 # Copyright (c) 2005 Linus Torvalds
 
-GIT_DIR=`git-rev-parse --git-dir` || exit $?
-
-usage () {
-    echo >&2 "Usage: git-tag [-a | -s | -u <key-id>] [-f | -d] [-m <msg>] <tagname> [<head>]"
-    exit 1
-}
-
-die () {
-    echo >&2 "$*"
-    exit 1
-}
+USAGE='[-a | -s | -u <key-id>] [-f | -d] [-m <msg>] <tagname> [<head>]'
+SUBDIRECTORY_OK='Yes'
+. git-sh-setup
 
 annotate=
 signed=
 
 annotate=
 signed=