Subject: Re: [PATCH v2 06/19] pull: pass verbosity, --progress flags to fetch and merge

From: Junio C Hamano <[email-masked]>
Date: Tue, 09 Jun 2015 16:36:45 -0700

Paul Tan <[email-masked]> 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.