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

Re: [Outreachy PATCH v3 1/2] parse-options: answer --git-completion-helper before command runs

From
CUCynthia Uche <herroyalpriestess@gmail.com>
Date
Nov 3, 2026, 09:25 UTC
Message-ID
<20261103092503.14872-1-herroyalpriestess@gmail.com>
In-Reply-To
<20261029231621.48958-1-tangajoris@gmail.com>
Hi Tanga,

I applied v3 1/2 and 2/2 on top of master (ebdc087dc9) and built with NO_RUST=1. t9300, t0012 and t9902 pass. On master, "git --list-cmds=parseopt" lists none of diff-pairs, fast-import, patch-id and var; with the series it lists all four, and the first three print their options with --git-completion-helper.

On Fri, Oct 30, 2026 at 12:17 AM Tanga Joris <tangajoris@gmail.com> wrote:
> +		} else if (!strcmp(av[1], "--git-completion-helper-all")) {
> +			show_gitcomp(opts, 1);
> +			exit(0);

Since this affects every caller of show_usage_with_options_if_asked(), I ran "git <cmd> --git-completion-helper" and the "-all" form with </dev/null for every builtin in an empty repository, with builds of master and of the series, and compared stdout, stderr and the exit status. They were identical.

The new t9300 test fails without the parse-options.c change, so it guards the fix, but it only covers the plain form: with the "-all" branch changed to show_gitcomp(opts, 0) it still passes. Could you add a test for that branch? This one fails with that change and passes without it:

  test_expect_success 'R: --git-completion-helper-all does not read from stdin' '
  	echo garbage | git fast-import --git-completion-helper-all >all &&
  	test_grep -e "--allow-unsafe-features" all
  '
Cynthia
Previous: Tanga JorisNext: Tanga Joris
Message 14 of 18 in “git.c: drop NO_PARSEOPT from builtins that use parse-options”
  1. git.c: drop NO_PARSEOPT from builtins that use parse-optionsTanga Joris, Oct 24, 2026
  2. René ScharfeOct 25, 2026
  3. Tanga JorisOct 26, 2026
  4. Junio C HamanoOct 26, 2026
  5. 1/2 fast-import: handle --git-completion-helper before reading inputTanga Joris, Oct 29, 2026
  6. 2/2 git.c: drop NO_PARSEOPT from builtins that use parse-optionsTanga Joris, Oct 29, 2026
  7. Junio C HamanoOct 29, 2026
  8. 1/2 parse-options: answer --git-completion-helper before command runsTanga Joris, Oct 29, 2026
  9. 2/2 git.c: drop NO_PARSEOPT from builtins that use parse-optionsTanga Joris, Oct 29, 2026
  10. Kaartic SivaraamOct 30, 2026
  11. Tanga JorisNov 2, 2026
  12. Kaartic SivaraamOct 30, 2026
  13. Tanga JorisOct 31, 2026
  14. Cynthia UcheNov 3, 2026
  15. Tanga JorisNov 4, 2026
  16. 1/3 parse-options: answer --git-completion-helper before command runsTanga Joris, Nov 5, 2026
  17. 2/3 git.c: drop NO_PARSEOPT from builtins that use parse-optionsTanga Joris, Nov 5, 2026
  18. 3/3 t0012: catch builtins that keep NO_PARSEOPT after conversionTanga Joris, Nov 5, 2026

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.