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 <gitster@pobox.com>
Junio C Hamano committed
Feb 27, 2020 at 08:10 UTC
1ff466c018692d0ac7c5f30a449632659e87a73b
2 files changed
+8
-1
Documentation/git-ls-remote.txt
+3
-1
@@ -28,7 +28,9 @@ OPTIONS
28
Limit to only refs/heads and refs/tags, respectively.
29
These options are _not_ mutually exclusive; when given
30
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.
34
35
--refs::
36
Do not show peeled tags or pseudorefs like HEAD in the output.
Documentation/gitcli.txt
+5
@@ -120,6 +120,11 @@ usage: git describe [<options>] <commit-ish>*
120
--long always use long format
121
--abbrev[=<n>] use <n> digits to display SHA-1s
122
---------------------------------------------
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.
128
129
--help-all::
130
Some Git commands take options that are only used for plumbing or that