git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 17:18 UTC

Re: [PATCH GSOC] diff: use conventional comparison order

From
Tian Yuchen <cat@malon.dev>
Date
Mar 14, 2026, 03:59 UTC
Message-ID
<405c075b-731b-47e3-9e9c-70aaa0efe1cc@malon.dev>
In-Reply-To
<xmqqldfv4h6k.fsf@gitster.g>
On 3/14/26 04:18, Junio C Hamano wrote:
> You guessed wrong.  See CodingGuidelines.
It does have nothing to do with the compiler. Thanks for pointing out.
However, the coding guidelines state:
> Both are valid, and we use both.
So, the real key is this sentence:
> Just do not mix styles in the same part of the code and mimic
> existing styles in the neighbourhood.

However, in builtin/add.c before the patch, there isn't even a single “>” symbol used for comparison. The “<” symbol is used throughout the comparison sections.

I find it quite strange because the author says:
> to follow the common coding style
This patch seems more like it breaks the common coding style.
Regards,
Yuchen
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 5 in “diff: use conventional comparison order”
  1. diff: use conventional comparison orderaum2357, Mar 13, 2026
  2. Tian YuchenMar 13, 2026
  3. Junio C HamanoMar 13, 2026
  4. Tian YuchenMar 14, 2026
  5. Junio C HamanoMar 14, 2026

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.