git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Alt. PATCH] ls-remote: deprecate -h as short for --heads

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
Oct 17, 2017, 17:40 UTC
Message-ID
<CAN0heSrR5v3JSXiQaqNTzf58G_CAXO-rL4W-GhQzb+OqLjK6QQ@mail.gmail.com>
In-Reply-To
<774f08bd-3172-0083-1544-e5f68f6798fa@web.de>
On 17 October 2017 at 17:39, René Scharfe <l.s.r@web.de> wrote:
Show 10 quoted lines
> Stop advertising -h as the short equivalent of --heads, because it's
> used for showing a short help text for almost all other git commands.
> Since the ba5f28bf79 (ls-remote: use parse-options api) it has only
> been working when used together with other parameters anyway.
>
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---
> That would be step on the way towards more consistent command line
> switches, in the same vein as d69155119 (t0012: test "-h" with
> builtins).

FWIW, my first inclination would be to go with a patch like this instead of the other two (where you introduce an exception so that git ls-remote -h does not display the usage). ba5f28bf79 was in 2.8.0. That's 18 months ago. Not an eternity, but still some time ago. Not fixing this regression has an obvious downside, but there's also a downside to adding the exception.

As long as a lone -h may give the usage or do something else entirely, then -- put bluntly -- to know whether you can request the usage with git foo -h without risk of messing up your repo, you'll need to look up the usage some other way. At which point you've solved your original problem, without -h.

Of course, we could promise that -h will give the usage or, in case of historical wart(s), do something harmless. But it seems a bit awkward, and might limit the perceived usefulness/safeness or -h.

Show 12 quoted lines
> diff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt
> index 5f2628c8f8..898836a111 100644
> --- a/Documentation/git-ls-remote.txt
> +++ b/Documentation/git-ls-remote.txt
> @@ -21,7 +21,6 @@ commit IDs.
>
>  OPTIONS
>  -------
> --h::
>  --heads::
>  -t::
>  --tags::

Do we want to document -h as a deprecated alias, so that people have a slightly larger chance of noticing and adapting?

Previous: René ScharfeNext: Jonathan Nieder
Message 7 of 23 in “Bug: git ls-remote -h / --head results differ in output”
  1. Thomas RiklOct 15, 2017
  2. Martin ÅgrenOct 15, 2017
  3. René ScharfeOct 15, 2017
  4. 1/2 git: add NO_INTERNAL_HELP flag for builtinsRené Scharfe, Oct 17, 2017
  5. Jonathan NiederOct 17, 2017
  6. ls-remote: deprecate -h as short for --headsRené Scharfe, Oct 17, 2017
  7. Martin ÅgrenOct 17, 2017
  8. Jonathan NiederOct 17, 2017
  9. Junio C HamanoOct 17, 2017
  10. René ScharfeOct 19, 2017
  11. Jeff KingOct 19, 2017
  12. Junio C HamanoOct 20, 2017
  13. Jeff KingOct 20, 2017
  14. Junio C HamanoOct 20, 2017
  15. Jeff KingOct 21, 2017
  16. René ScharfeOct 21, 2017
  17. Junio C HamanoOct 21, 2017
  18. René ScharfeOct 23, 2017
  19. Junio C HamanoOct 24, 2017
  20. René ScharfeOct 24, 2017
  21. 2/2 ls-remote: use PARSE_OPT_NO_INTERNAL_HELPRené Scharfe, Oct 17, 2017
  22. Jonathan NiederOct 17, 2017
  23. Martin ÅgrenOct 17, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.