bisect: add "git bisect help" subcommand to get a long usage string

Users are not often aware of the fact that "git bisect -h" can give
them a long usage description, as "git bisect" seems to accept only
dashless subcommands like "start", "good", ...

That's why this patch adds a "git bisect help" subcommand that just
calls "git bisect -h". This new subcommand is also fully documented
in the short usage string (that "git bisect" gives), in the long
usage string and in the man page (that "git help bisect" gives).

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Christian Couder
2008-04-11 05:55:21 +02:00
committed by Junio C Hamano
parent 3c5283f8b1
commit 243a60fbb5
2 changed files with 16 additions and 3 deletions

View File

@ -15,6 +15,7 @@ DESCRIPTION
The command takes various subcommands, and different options depending The command takes various subcommands, and different options depending
on the subcommand: on the subcommand:
git bisect help
git bisect start [<bad> [<good>...]] [--] [<paths>...] git bisect start [<bad> [<good>...]] [--] [<paths>...]
git bisect bad [<rev>] git bisect bad [<rev>]
git bisect good [<rev>...] git bisect good [<rev>...]
@ -29,6 +30,12 @@ This command uses 'git-rev-list --bisect' option to help drive the
binary search process to find which change introduced a bug, given an binary search process to find which change introduced a bug, given an
old "good" commit object name and a later "bad" commit object name. old "good" commit object name and a later "bad" commit object name.
Getting help
~~~~~~~~~~~~
Use "git bisect" to get a short usage description, and "git bisect
help" or "git bisect -h" to get a long usage description.
Basic bisect commands: start, bad, good Basic bisect commands: start, bad, good
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -1,7 +1,9 @@
#!/bin/sh #!/bin/sh
USAGE='[start|bad|good|skip|next|reset|visualize|replay|log|run]' USAGE='[help|start|bad|good|skip|next|reset|visualize|replay|log|run]'
LONG_USAGE='git bisect start [<bad> [<good>...]] [--] [<pathspec>...] LONG_USAGE='git bisect help
print this long help message.
git bisect start [<bad> [<good>...]] [--] [<pathspec>...]
reset bisect state and start bisection. reset bisect state and start bisection.
git bisect bad [<rev>] git bisect bad [<rev>]
mark <rev> a known-bad revision. mark <rev> a known-bad revision.
@ -20,7 +22,9 @@ git bisect replay <logfile>
git bisect log git bisect log
show bisect log. show bisect log.
git bisect run <cmd>... git bisect run <cmd>...
use <cmd>... to automatically bisect.' use <cmd>... to automatically bisect.
Please use "git help bisect" to get the full man page.'
OPTIONS_SPEC= OPTIONS_SPEC=
. git-sh-setup . git-sh-setup
@ -465,6 +469,8 @@ case "$#" in
cmd="$1" cmd="$1"
shift shift
case "$cmd" in case "$cmd" in
help)
git bisect -h ;;
start) start)
bisect_start "$@" ;; bisect_start "$@" ;;
bad|good|skip) bad|good|skip)