Paul Tan <[email protected]> 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.
> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html