From: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
To: Tanga Joris <tangajoris@gmail.com>, git@vger.kernel.org
Cc: l.s.r@web.de, gitster@pobox.com, christian.couder@gmail.com,
siddharthasthana31@gmail.com, usmanakinyemi202@gmail.com
Subject: Re: [Outreachy PATCH v3 1/2] parse-options: answer --git-completion-helper before command runs
Date: Fri, 30 Oct 2026 15:14:45 +0530 [thread overview]
Message-ID: <123de4e4-3387-4eef-8a05-9ed1ad1fce30@gmail.com> (raw)
In-Reply-To: <20261029231621.48958-1-tangajoris@gmail.com>
Hi Tanga Joris,
Just a gentle reminder about this portion of the MyFirstContribution[1]:
It’s good manners to reply to each comment in the mailing list
discussion instead of letting the next version of your patch be your
only response. Tell the reviewer whether you plan to make the
suggested change, keep the original, or pursue a different approach.
This way reviewers can respond to your reasoning before you spend time
preparing a version they may not agree with, and later do not need to
inspect your v2 to figure out whether you implemented their comment or
not.
On 10/30/26 04:46, Tanga Joris wrote:
> fast-import parses its options only after reading the "feature"
> lines from its input, and it creates a temporary pack file before
> that. So "git fast-import --git-completion-helper" waits for input,
> and each run leaves a tmp_pack_* file behind.
>
> bash completion runs the helper with the terminal as input, so
> "git fast-import --<TAB>" would freeze once fast-import is no
> longer marked with the NO_PARSEOPT flag.
>
May be give a hint that you plan to do this in the following commit?
That might give someone without context (for example someone reading the
commit after a while) a hint about why you are worrying about marking
fast-import with the NO_PARSEOPT flag.
> Since show_usage_with_options_if_asked() already answers -h and
> --help-all before a command does any work, it now also answers
> the completion helper, so fast-import and other commands that
> call it reply without reading input.
>
> Reported-by: René Scharfe <l.s.r@web.de>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Tanga Joris <tangajoris@gmail.com>
> ---
> Changes since v2:
> - Moved the check from fast-import into
> show_usage_with_options_if_asked() in parse-options,
> as Junio suggested.
> - 2/2 is unchanged
>
> parse-options.c | 6 ++++++
> t/t9300-fast-import.sh | 8 ++++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/parse-options.c b/parse-options.c
> index 283a0f1dc2..f2a23b79a4 100644
> --- a/parse-options.c
> +++ b/parse-options.c
> @@ -1536,6 +1536,12 @@ void show_usage_with_options_if_asked(int ac, const char **av,
> usage_with_options_internal(NULL, usagestr, opts,
> USAGE_FULL, USAGE_TO_STDOUT);
> exit(0);
> + } else if (!strcmp(av[1], "--git-completion-helper")) {
> + show_gitcomp(opts, 0);
> + exit(0);
> + } else if (!strcmp(av[1], "--git-completion-helper-all")) {
> + show_gitcomp(opts, 1);
> + exit(0);
> }
> }
> }
The change seems to be fine but I wonder if it is worth a note in
parse-options.h about why show_usage_with_options_if_asked() is also
handling the '--git-completion-helper' and '--git-completion-helper-all'
arguments?
[ References ]
[1]: https://git-scm.com/docs/MyFirstContribution#reviewing
--
Sivaraam
prev parent reply other threads:[~2026-10-30 9:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 5:24 [Outreachy PATCH] git.c: drop NO_PARSEOPT from builtins that use parse-options Tanga Joris
2026-10-25 7:59 ` René Scharfe
2026-10-26 2:59 ` Tanga Joris
2026-10-26 4:58 ` Junio C Hamano
2026-10-29 1:26 ` [Outreachy PATCH v2 1/2] fast-import: handle --git-completion-helper before reading input Tanga Joris
2026-10-29 1:26 ` [Outreachy PATCH v2 2/2] git.c: drop NO_PARSEOPT from builtins that use parse-options Tanga Joris
2026-10-29 18:04 ` [Outreachy PATCH v2 1/2] fast-import: handle --git-completion-helper before reading input Junio C Hamano
2026-10-29 23:16 ` [Outreachy PATCH v3 1/2] parse-options: answer --git-completion-helper before command runs Tanga Joris
2026-10-29 23:16 ` [Outreachy PATCH v3 2/2] git.c: drop NO_PARSEOPT from builtins that use parse-options Tanga Joris
2026-10-30 10:21 ` Kaartic Sivaraam
2026-10-30 9:44 ` Kaartic Sivaraam [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=123de4e4-3387-4eef-8a05-9ed1ad1fce30@gmail.com \
--to=kaartic.sivaraam@gmail.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=l.s.r@web.de \
--cc=siddharthasthana31@gmail.com \
--cc=tangajoris@gmail.com \
--cc=usmanakinyemi202@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox