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

Re: [Outreachy PATCH] git.c: drop NO_PARSEOPT from builtins that use parse-options

From
René Scharfe <l.s.r@web.de>
Date
Oct 25, 2026, 07:59 UTC
Message-ID
<8b60c7f6-4a1c-495a-a594-aaf322279539@web.de>
In-Reply-To
<20261024052449.95869-1-tangajoris@gmail.com>
On 10/24/26 7:24 AM, Tanga Joris wrote:
Show 23 quoted lines
> The NO_PARSEOPT flag in the commands[] table marks builtins that
> parse their options by hand. Builtins marked with it are left out
> of "git --list-cmds=parseopt", which bash completion uses to
> decide whether it can ask a command for its options with
> "--git-completion-helper".
> 
> Four builtins have since been converted to parse-options, but are
> still marked NO_PARSEOPT:
> 
>  - patch-id, in 2871f4d447 (builtin: patch-id: add --verbatim as a
>    command mode, 2022-10-24)
>  - diff-pairs, which has used parse-options since it was introduced
>    in 5bd10b2adc (builtin: introduce diff-pairs command, 2025-02-28)
>  - fast-import, in 863937696e (fast-import: use parse_options() for
>    command line options, 2026-08-11)
>  - var, in e19f0779c6 (var: add "-z" output mode, 2026-09-26)
> 
> This causes "git fast-import --<TAB>", "git patch-id --<TAB>" and
> "git diff-pairs --<TAB>" to offer no options, even though they are
> listed by "--git-completion-helper".
> 
> Remove the flag from these four builtins, like 66fa6e8ed8 (git.c:
> update NO_PARSEOPT markings, 2022-08-19) did for others.
Good idea!

"git fast-import --git-completion-helper" prints its command line options only after it gets fed a line of input. That's odd. Do the completion scripts still work seamlessly, i.e. without requiring the user to press <return>?

René
Previous: Tanga JorisNext: Tanga Joris
Message 2 of 13 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

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.