Skip to content

Commit 1ff466c

Browse files
committed
Documentation: clarify that -h alone stands for help
We seem to be getting new users who get confused every 20 months or so with this "-h consistently wants to give help, but the commands to which `-h` may feel like a good short-form option want it to mean something else." compromise. Let's make sure that the readers know that `git cmd -h` (with no other arguments) is a way to get usage text, even for commands like ls-remote and grep. Also extend the description that is already in gitcli.txt, as it is clear that users still get confused with the current text. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4cd1cf3 commit 1ff466c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Documentation/git-ls-remote.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ OPTIONS
2828
Limit to only refs/heads and refs/tags, respectively.
2929
These options are _not_ mutually exclusive; when given
3030
both, references stored in refs/heads and refs/tags are
31-
displayed.
31+
displayed. Note that `git ls-remote -h` used without
32+
anything else on the command line gives help, consistent
33+
with other git subcommands.
3234

3335
--refs::
3436
Do not show peeled tags or pseudorefs like HEAD in the output.

Documentation/gitcli.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ usage: git describe [<options>] <commit-ish>*
120120
--long always use long format
121121
--abbrev[=<n>] use <n> digits to display SHA-1s
122122
---------------------------------------------
123+
+
124+
Note that some subcommand (e.g. `git grep`) may behave differently
125+
when there are things on the command line other than `-h`, but `git
126+
subcmd -h` without anything else on the command line is meant to
127+
consistently give the usage.
123128

124129
--help-all::
125130
Some Git commands take options that are only used for plumbing or that

0 commit comments

Comments
 (0)