]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Documentation: clarify that `-h` alone stands for `help`
authorJunio C Hamano <gitster@pobox.com>
Thu, 27 Feb 2020 16:10:20 +0000 (08:10 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Feb 2020 22:14:01 +0000 (14:14 -0800)
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>
Documentation/git-ls-remote.txt
Documentation/gitcli.txt

index b9fd3770a6ce19c341c421e07b68985d89d94df5..c9e68582a422ff1f649c7b7a33aeb2bf5191012b 100644 (file)
@@ -28,7 +28,9 @@ OPTIONS
        Limit to only refs/heads and refs/tags, respectively.
        These options are _not_ mutually exclusive; when given
        both, references stored in refs/heads and refs/tags are
-       displayed.
+       displayed.  Note that `git ls-remote -h` used without
+       anything else on the command line gives help, consistent
+       with other git subcommands.
 
 --refs::
        Do not show peeled tags or pseudorefs like HEAD in the output.
index 592e06d839d87f28cf6cbbdcf3aa3253da2eb9f0..06608ea2059b375bbdbbe677846b6154bc61e9f8 100644 (file)
@@ -120,6 +120,11 @@ usage: git describe [<options>] <commit-ish>*
     --long                always use long format
     --abbrev[=<n>]        use <n> digits to display SHA-1s
 ---------------------------------------------
++
+Note that some subcommand (e.g. `git grep`) may behave differently
+when there are things on the command line other than `-h`, but `git
+subcmd -h` without anything else on the command line is meant to
+consistently give the usage.
 
 --help-all::
        Some Git commands take options that are only used for plumbing or that