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

[PATCH 0/8] consistent "-h" handling in builtins

From
Jeff King <peff@peff.net>
Date
May 30, 2017, 05:09 UTC
Message-ID
<20170530050949.dkgu3u26qj6ycusy@sigill.intra.peff.net>
In-Reply-To
<20170529153250.zq4qz3s5fmztc6ih@sigill.intra.peff.net>
On Mon, May 29, 2017 at 11:32:50AM -0400, Jeff King wrote:
> I'll try to put together patches in the next day or so. Comments welcome
> in the meantime.

So here they are. For those just joining us, the immediate problem is that "git am -h" is broken (whether you're in a repo or not). That's fixed by the first patch, which can go to "maint" separately (although the rest are pretty unadventurous).

The rest of it cleans up "-h" handling for a variety of builtin commands, and then adds a test to make sure they all behave sanely (which unsurprisingly is how I found all the problems fixed by the earlier patches).

  [1/8]: am: handle "-h" argument earlier
  [2/8]: credential: handle invalid arguments earlier
  [3/8]: upload-archive: handle "-h" option early
  [4/8]: remote-{ext,fd}: print usage message on invalid arguments
  [5/8]: submodule--helper: show usage for "-h"
  [6/8]: version: convert to parse-options
  [7/8]: git: add hidden --list-builtins option
  [8/8]: t0012: test "-h" with builtins
 builtin/am.c                |  3 +++
 builtin/credential.c        |  4 ++--
 builtin/remote-ext.c        |  5 ++++-
 builtin/remote-fd.c         |  5 ++++-
 builtin/submodule--helper.c |  5 ++---
 builtin/upload-archive.c    |  5 ++++-
 git.c                       | 12 ++++++++++++
 help.c                      | 25 ++++++++++++++++++++-----
 t/t0012-help.sh             | 12 ++++++++++++
 9 files changed, 63 insertions(+), 13 deletions(-)
-Peff
Previous: Jeff KingNext: Jeff King
Message 4 of 38 in “[Bug] setup_git_env called without repository”
  1. Zero KingMay 29, 2017
  2. Ævar Arnfjörð BjarmasonMay 29, 2017
  3. Jeff KingMay 29, 2017
  4. 0/8 consistent "-h" handling in builtinsJeff King, May 30, 2017
  5. 1/8 am: handle "-h" argument earlierJeff King, May 30, 2017
  6. Junio C HamanoMay 30, 2017
  7. 2/8 credential: handle invalid arguments earlierJeff King, May 30, 2017
  8. 3/8 upload-archive: handle "-h" option earlyJeff King, May 30, 2017
  9. 4/8 remote-{ext,fd}: print usage message on invalid argumentsJeff King, May 30, 2017
  10. 5/8 submodule--helper: show usage for "-h"Jeff King, May 30, 2017
  11. 6/8 version: convert to parse-optionsJeff King, May 30, 2017
  12. version: move --build-options to a test helperÆvar Arnfjörð Bjarmason, May 30, 2017
  13. Jeff KingMay 30, 2017
  14. Johannes SchindelinMay 31, 2017
  15. Jeff KingMay 31, 2017
  16. Johannes SchindelinMay 31, 2017
  17. Ævar Arnfjörð BjarmasonMay 31, 2017
  18. Jeff KingMay 31, 2017
  19. 7/8 git: add hidden --list-builtins optionJeff King, May 30, 2017
  20. 8/8 t0012: test "-h" with builtinsJeff King, May 30, 2017
  21. Junio C HamanoMay 30, 2017
  22. Jeff KingMay 30, 2017
  23. Junio C HamanoMay 30, 2017
  24. Jeff KingMay 30, 2017
  25. Junio C HamanoMay 30, 2017
  26. Jeff KingMay 30, 2017
  27. Jeff KingMay 30, 2017
  28. Junio C HamanoMay 30, 2017
  29. Junio C HamanoJun 1, 2017
  30. Jeff KingJun 1, 2017
  31. Junio C HamanoJun 1, 2017
  32. Junio C HamanoJun 1, 2017
  33. Jeff KingJun 1, 2017
  34. Junio C HamanoJun 1, 2017
  35. Jeff KingJun 1, 2017
  36. Jonathan NiederJun 13, 2017
  37. Jeff KingJun 14, 2017
  38. Junio C HamanoMay 30, 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.