git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Junio C HamanoNext: Josh Triplett
Message 7 of 12 in “format-patch: Add a config option format.from to set the default for --from”
  1. 1/2 format-patch: Add a config option format.from to set the default for --fromJosh Triplett, Jul 30, 2016
  2. Jeff KingAug 1, 2016
  3. Josh TriplettAug 7, 2016
  4. Junio C HamanoAug 8, 2016
  5. Josh TriplettAug 8, 2016
  6. Junio C HamanoAug 8, 2016
  7. Junio C HamanoAug 1, 2016
  8. Josh TriplettAug 8, 2016
  9. Jeff KingAug 8, 2016
  10. Josh TriplettAug 8, 2016
  11. Jeff KingAug 8, 2016
  12. 2/2 format-patch: Default to --fromJosh Triplett, Jul 30, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.