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

[PATCH v3 0/3] permit -h/--help-all in more scenarios

From
D. Ben Knoble <ben.knoble+github@gmail.com>
Date
Aug 3, 2025, 16:10 UTC
Message-ID
<20250803161033.77696-1-ben.knoble+github@gmail.com>
In-Reply-To
<20250803012613.54086-1-ben.knoble+github@gmail.com>
Changes from v2:
- Rebase on unpublished ua/t1517… v5 (https://lore.kernel.org/git/20250803020744.1037392-1-usmanakinyemi202@gmail.com/)
  which is rebased on master
- Changed fixup to account for instaweb Perl dependency
Changes from v1:
- tweak refactor commit message to indicate no behavior is changed;
- use #define'd constants instead of an enum for internal flags;
- drop controversial [4/4]
QQ: Is there a better way to add --cc's to format-patch than grabbing
the right folks off threads from lore.kernel.org/git? (I could also grab
them out of my mail client.) I assume this is where using tools like b4
starts to really shine? To be clear: I mean CC's _in addition to_ the
use of
    sendemail.ccCmd = perl contrib/contacts/git-contacts

to keep folks that participated in prior rounds of discussion abreast of the next version.

-------- Original --------

This series depends on ua/t1517-short-help-tests with some fixes, which show up in the first patch. Start a new topic from the (unpublished) v5 of that branch:

    git switch -c topic origin/master
    git am ua/t1517-short-help-tests-v5.mbox
Then apply this series.

This series enables --help-all outside of repository contexts, and allows -h with other arguments (without breaking existing ls-remote/grep usage).

It consists of preparatory steps (fixes for a dependency branch; refactoring to make an internal helper's arguments clearer) followed by the main commits.

v1: https://lore.kernel.org/git/20250726165320.4039-1-ben.knoble+github@gmail.com/
v2: https://lore.kernel.org/git/20250803012613.54086-1-ben.knoble+github@gmail.com/
Published-as: https://github.com/benknoble/git/tree/help-all-tweaks
D. Ben Knoble (3):
  t1517: fixup for ua/t1517-short-help-tests
  parse-options: refactor flags for usage_with_options_internal
  builtin: also setup gently for --help-all
 builtin/merge-recursive.c |  3 ++-
 git.c                     |  2 +-
 parse-options.c           | 30 +++++++++++++++++++++++-------
 t/t1517-outside-repo.sh   | 12 +++++++++++-
 usage.c                   |  3 ++-
 5 files changed, 39 insertions(+), 11 deletions(-)
Diff-intervalle contre v2 :
1:  e552926bc4 < -:  ---------- t/t1517: automate `git subcmd -h` tests outside a repository
2:  344c7067e6 < -:  ---------- t5200: move `update-server-info -h` test from t1517
3:  7a3e0a601d < -:  ---------- t1517: fixup for ua/t1517-short-help-tests
-:  ---------- > 1:  855931592f t1517: fixup for ua/t1517-short-help-tests
4:  db74b1eff7 = 2:  2392039374 parse-options: refactor flags for usage_with_options_internal
5:  cb4113f77d ! 3:  4dfc046e6d builtin: also setup gently for --help-all
    @@ t/t1517-outside-repo.sh
      		test_expect_code 129 nongit git $cmd -h >usage &&
      		test_grep "[Uu]sage: git $cmd " usage
      	'
    -+	test_$expect_outcome "'git $cmd --help-all' outside a repository" '
    ++	test_$expect_outcome $prereq "'git $cmd --help-all' outside a repository" '
     +		test_expect_code 129 nongit git $cmd --help-all >usage &&
     +		test_grep "[Uu]sage: git $cmd " usage
     +	'
      done
      
    - test_expect_success 'prune does not crash with -h' '
    + test_done
     
      ## usage.c ##
     @@ usage.c: static void show_usage_if_asked_helper(const char *err, ...)

base-commit: 866e6a391f466baeeb98bc585845ea638322c04b prerequisite-patch-id: eb2c55de73b2b733aa0c8c94469a45d9bc361d81 prerequisite-patch-id: 12ddad29e334853cf61c797a2c08302893f4b909 prerequisite-patch-id: 250bae2541030fcdfc5b35ede44c23e1138c7a3c

-- 
2.48.1
Previous: D. Ben KnobleNext: Junio C Hamano
Message 20 of 30 in “permit -h/--help-all in more scenarios”
  1. 0/4 permit -h/--help-all in more scenariosD. Ben Knoble, Jul 26, 2025
  2. 1/4 t1517: fixup for ua/t1517-short-help-testsD. Ben Knoble, Jul 26, 2025
  3. Usman AkinyemiJul 26, 2025
  4. Junio C HamanoJul 28, 2025
  5. 2/4 parse-options: name flags passed to usage_with_options_internalD. Ben Knoble, Jul 26, 2025
  6. Junio C HamanoJul 28, 2025
  7. Junio C HamanoJul 28, 2025
  8. D. Ben KnobleJul 30, 2025
  9. 3/4 builtin: also setup gently for --help-allD. Ben Knoble, Jul 26, 2025
  10. Junio C HamanoJul 28, 2025
  11. D. Ben KnobleJul 30, 2025
  12. 4/4 builtins: show help on "-h"/"--help-all" with more than 2 arguments leftD. Ben Knoble, Jul 26, 2025
  13. Junio C HamanoJul 27, 2025
  14. D. Ben KnobleJul 30, 2025
  15. Jeff KingAug 2, 2025
  16. D. Ben KnobleAug 2, 2025
  17. Jeff KingAug 2, 2025
  18. D. Ben KnobleAug 2, 2025
  19. 0/3 permit -h/--help-all in more scenariosD. Ben Knoble, Aug 3, 2025
  20. 0/3 permit -h/--help-all in more scenariosD. Ben Knoble, Aug 3, 2025
  21. Junio C HamanoAug 4, 2025
  22. D. Ben KnobleAug 5, 2025
  23. 1/3 t1517: fixup for ua/t1517-short-help-testsD. Ben Knoble, Aug 3, 2025
  24. Junio C HamanoAug 3, 2025
  25. D. Ben KnobleAug 3, 2025
  26. 2/3 parse-options: refactor flags for usage_with_options_internalD. Ben Knoble, Aug 3, 2025
  27. 3/3 builtin: also setup gently for --help-allD. Ben Knoble, Aug 3, 2025
  28. 1/3 t1517: fixup for ua/t1517-short-help-testsD. Ben Knoble, Aug 3, 2025
  29. 2/3 parse-options: refactor flags for usage_with_options_internalD. Ben Knoble, Aug 3, 2025
  30. 3/3 builtin: also setup gently for --help-allD. Ben Knoble, Aug 3, 2025

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.