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

Re: [PATCH v4] gpg-interface.c: detect and reject multiple signatures on commits

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 22, 2018, 00:58 UTC
Message-ID
<xmqqefciztit.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<1540105841.1174.1.camel@gentoo.org>
Michał Górny <mgorny@gentoo.org> writes:
Show 15 quoted lines
>> Very minor point but by not using pre-increment, i.e.
>> 
>> 		if (seen_exclusive_status++)
>> 			goto found_duplicate_status;
>> 
>> you can use the expression as a "have we already seen?" boolean,
>> whic may probably be more idiomatic.
>> 
>> The patch is good in the way written as-is, and this is so minor
>> that it is not worth rerolling to only update this part.
>> 
>
> Sure, thanks.  For the record, I've been taught to use pre-increment
> whenever possible to avoid copying the variable but I suppose it doesn't
> really matter here.  Just a habit.

Yes, it's a habit many C++ trained people spread; it just looks weird to see a pre-increment of a "have we done this once?" variable and end up comparing to see if it is strictly greater than 1 (i.e. have we reached 2 or more?).

Previous: Michał GórnyNext: Michał Górny
Message 4 of 11 in “gpg-interface.c: detect and reject multiple signatures on commits”
  1. gpg-interface.c: detect and reject multiple signatures on commitsMichał Górny, Oct 20, 2018
  2. Junio C HamanoOct 20, 2018
  3. Michał GórnyOct 21, 2018
  4. Junio C HamanoOct 22, 2018
  5. Michał GórnyOct 22, 2018
  6. Michał GórnyOct 22, 2018
  7. Duy NguyenNov 3, 2018
  8. Michał GórnyNov 3, 2018
  9. Duy NguyenNov 3, 2018
  10. Michał GórnyNov 3, 2018
  11. Duy NguyenNov 3, 2018

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.