Re: [PATCH v2 1/2] format-patch: Add a config option format.from to set the default for --from
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 1, 2016, 21:18 UTC
- Message-ID
- <xmqqziowgpc8.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160730191111.cd6ay3l4hweyjf7f@x>
Josh Triplett <josh@joshtriplett.org> writes:
> Subject: Re: [PATCH v2 1/2] format-patch: Add a config option format.from ...
At least s/Add/add/; but I would prefer an even shorter
format-patch: format.from gives the default for --from
> +static char *from;
The same "this does not quite help the transition" comment applies to this one.
> +enum from {
> + FROM_AUTHOR,
> + FROM_USER,
> + FROM_VALUE,Drop trailing comma after the last enum definition (trailing comma after the last element in an array is OK, though).
Show 15 quoted lines
> +static void set_from(enum from type, const char *value)
> +{
> + free(from);
> + switch (type) {
> + case FROM_AUTHOR:
> + from = NULL;
> + break;
> + case FROM_USER:
> + from = xstrdup(git_committer_info(IDENT_NO_DATE));
> + break;
> + case FROM_VALUE:
> + from = xstrdup(value);
> + break;
> + }
> +}I tend to agree with what Jeff said; I'd queue 1/2 from the original round for now.
Thanks.