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
René Scharfe <l.s.r@web.de>
Date
Oct 23, 2017, 15:05 UTC
Message-ID
<7c53071a-5154-1246-d2f1-1064e3f923d4@web.de>
In-Reply-To
<xmqqh8usg0cs.fsf@gitster.mtv.corp.google.com>
Am 21.10.2017 um 14:18 schrieb Junio C Hamano:
Show 10 quoted lines
> René Scharfe <l.s.r@web.de> writes:
> 
>> FWIW, I use "-?" for that everywhere.  I have yet to find a command or
>> environment where it does something dangerous.
> 
> Yeah, it would have made the world a better place if we made that
> choice back in 2008.  If we start a transition to make it so right
> now, we might be able to make the world a better place by 2022,
> perhaps.  I am not sure if the pain during the transition is worth
> it, though.

"-?" works fine with builtins already -- they complain that the option is unknown and then show the short help text.

If we removed the special handling for "-h" from parse-options it would do the same for most commands, i.e. we'd get an additional error message, followed by the short help text that we're used to see. We could check for "git grep -h" without any other arguments and show the usage text in that case. We could do the same for "git ls-remote -h" as well, but I'm not sure we want to.

So the cost would be an extra error message in most cases, and possibly the inability to show help with "git ls-remote -h". That doesn't sound very painful.

René
Previous: Junio C HamanoNext: Junio C Hamano
Message 18 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.