Skip to content

Commit 243a60f

Browse files
chriscoolgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3c5283f commit 243a60f

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Documentation/git-bisect.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ DESCRIPTION
1515
The command takes various subcommands, and different options depending
1616
on the subcommand:
1717

18+
git bisect help
1819
git bisect start [<bad> [<good>...]] [--] [<paths>...]
1920
git bisect bad [<rev>]
2021
git bisect good [<rev>...]
@@ -29,6 +30,12 @@ This command uses 'git-rev-list --bisect' option to help drive the
2930
binary search process to find which change introduced a bug, given an
3031
old "good" commit object name and a later "bad" commit object name.
3132

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+
3239
Basic bisect commands: start, bad, good
3340
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3441

git-bisect.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/sh
22

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>...]
57
reset bisect state and start bisection.
68
git bisect bad [<rev>]
79
mark <rev> a known-bad revision.
@@ -20,7 +22,9 @@ git bisect replay <logfile>
2022
git bisect log
2123
show bisect log.
2224
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.'
2428

2529
OPTIONS_SPEC=
2630
. git-sh-setup
@@ -465,6 +469,8 @@ case "$#" in
465469
cmd="$1"
466470
shift
467471
case "$cmd" in
472+
help)
473+
git bisect -h ;;
468474
start)
469475
bisect_start "$@" ;;
470476
bad|good|skip)

0 commit comments

Comments
 (0)