@matheusbsbs / matheus-bagliano / commits / 243a60fbb5
Fork 0

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>

Christian Couder committed Apr 11, 2008 at 05:55 UTC 243a60fbb5e185e2bf3c4bb1c53128b4d04d5879
2 files changed +16 -3
Documentation/git-bisect.txt
+7
@@ -15,6 +15,7 @@ DESCRIPTION
15 The command takes various subcommands, and different options depending
16 on the subcommand:
17
18 + git bisect help
19 git bisect start [<bad> [<good>...]] [--] [<paths>...]
20 git bisect bad [<rev>]
21 git bisect good [<rev>...]
@@ -29,6 +30,12 @@ This command uses 'git-rev-list --bisect' option to help drive the
30 binary search process to find which change introduced a bug, given an
31 old "good" commit object name and a later "bad" commit object name.
32
33 +Getting help
34 +~~~~~~~~~~~~
35 +
36 +Use "git bisect" to get a short usage description, and "git bisect
37 +help" or "git bisect -h" to get a long usage description.
38 +
39 Basic bisect commands: start, bad, good
40 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41
git-bisect.sh
+9 -3
@@ -1,7 +1,9 @@
1 #!/bin/sh
2
3 -USAGE='[start|bad|good|skip|next|reset|visualize|replay|log|run]'
4 -LONG_USAGE='git bisect start [<bad> [<good>...]] [--] [<pathspec>...]
3 +USAGE='[help|start|bad|good|skip|next|reset|visualize|replay|log|run]'
4 +LONG_USAGE='git bisect help
5 + print this long help message.
6 +git bisect start [<bad> [<good>...]] [--] [<pathspec>...]
7 reset bisect state and start bisection.
8 git bisect bad [<rev>]
9 mark <rev> a known-bad revision.
@@ -20,7 +22,9 @@ git bisect replay <logfile>
22 git bisect log
23 show bisect log.
24 git bisect run <cmd>...
23 - use <cmd>... to automatically bisect.'
25 + use <cmd>... to automatically bisect.
26 +
27 +Please use "git help bisect" to get the full man page.'
28
29 OPTIONS_SPEC=
30 . git-sh-setup
@@ -465,6 +469,8 @@ case "$#" in
469 cmd="$1"
470 shift
471 case "$cmd" in
472 + help)
473 + git bisect -h ;;
474 start)
475 bisect_start "$@" ;;
476 bad|good|skip)