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
Josh Triplett <josh@joshtriplett.org>
Date
Aug 8, 2016, 04:42 UTC
Message-ID
<20160808044206.ubvaftex3mwbmwdh@x>
In-Reply-To
<xmqqziowgpc8.fsf@gitster.mtv.corp.google.com>
On Mon, Aug 01, 2016 at 02:18:47PM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> Josh Triplett <josh@joshtriplett.org> writes:
> > +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).

I realize this code didn't get included in the final version, but for future reference, what's the rationale for this? I tend to include a final comma in cases like these (and likewise for initializers) to avoid needing to change the last line when introducing a new element, reducing noise in diffs. I hadn't seen anything in any of the coding style documentation talking about trailing commas (either pro or con).

Previous: Junio C HamanoNext: Jeff King
Message 8 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.