Re: [Outreachy PATCH] git.c: drop NO_PARSEOPT from builtins that use parse-options
flat view
From: Tanga Joris <hidden>
Date: 2026-10-26 03:00:30
On Sun, 25 Oct 2026 at 10:59, René Scharfe [off-list ref] 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