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
TJTanga Joris <tangajoris@gmail.com>
Date
Oct 26, 2026, 02:59 UTC
Message-ID
<CAKrRMNqtqYiE2YKVky+mHyrkqtW2c_L_DcCen1hyaQa8D0+fWw@mail.gmail.com>
In-Reply-To
<8b60c7f6-4a1c-495a-a594-aaf322279539@web.de>
On Sun, 25 Oct 2026 at 10:59, René Scharfe <l.s.r@web.de> wrote:
> "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>?

Thanks for catching this. They don't. __git() in the completion script does not redirect stdin, so the helper reads from the terminal and "git fast-import --<TAB>" waits until the user presses <return> or ^D.

This seems to happen because fast-import only calls parse_options() once it sees the first command in the stream (or EOF), as it reads the "feature" lines first.

Since patch-id, diff-pairs and var return immediately, I'll send a v2 that still removes the NO_PARSEOPT flag from them, but keeps it on fast-import, for now, as I make a separate patch fixing the wait behaviour, and ultimately removing the flag.

The separate patch would teach fast-import to answer --git-completion-helper before reading its input, like it does for "-h".

Christian, I plan to base it on top of your early-scan series, since it touches the same code. Would you be fine with that?

Thanks, Tanga

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