Re: [PATCH v2 06/19] pull: pass verbosity, --progress flags to fetch and merge
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 9, 2015, 23:36 UTC
- Message-ID
- <xmqqioawwj1u.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1433314143-4478-7-git-send-email-pyokagan@gmail.com>
Paul Tan <pyokagan@gmail.com> writes:
> Re-implement support for this flag by introducing the option callback > handler parse_opt_passthru(). This callback is used to pass the > "--progress" or "--no-progress" command-line switch to git-fetch and > git-merge.
Forgot to rephrase? parse-opt-passthru() is a good name for "pass the single string, last one wins", but is implemented in another patch.
Use parse_opt_passthru() implemented earlier to pass the "--[no-]progress" command line options to git-fetch and git-merge.
or something like that.
Show 21 quoted lines
> diff --git a/builtin/pull.c b/builtin/pull.c
> index 0ca23a3..c9c2cc0 100644
> --- a/builtin/pull.c
> +++ b/builtin/pull.c
> @@ -16,11 +16,35 @@ static const char * const pull_usage[] = {
> NULL
> };
>
> +/* Shared options */
> +static int opt_verbosity;
> +static struct strbuf opt_progress = STRBUF_INIT;
> +
> static struct option pull_options[] = {
> + /* Shared options */
> + OPT__VERBOSITY(&opt_verbosity),
> + { OPTION_CALLBACK, 0, "progress", &opt_progress, NULL,
> + N_("force progress reporting"),
> + PARSE_OPT_NOARG, parse_opt_pass_strbuf},
> +
> OPT_END()
> };Seeing this use case convinces me that the new parse-opt callback parse-opt-pass-single-string-last-one-wins() in 01/19 should not be strbuf based interface but should be (const char *) based one.
Other than that the change looks nicely done. So far, the series has been a very pleasant read up to this step.