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

Re: [PATCH] Signed-off-by: aum2357 <ahambrahmasmi2357@gmail.com>

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 13, 2026, 17:43 UTC
Message-ID
<xmqqa4wb62xa.fsf@gitster.g>
In-Reply-To
<m1fr63zt91.fsf@gmail.com>
Collin Funk <collin.funk1@gmail.com> writes:
> Subject: Re: [PATCH] Signed-off-by: aum2357 <ahambrahmasmi2357@gmail.com>
The commit title is not where sign-off is made.
> aum2357 <ahambrahmasmi2357@gmail.com> writes:
>
>> diff: use conventional comparison order

The first line of the commit body begins with "diff:" but the patch is about "add".

Show 18 quoted lines
>> Replace `0 <= addremove_explicit` with `addremove_explicit >= 0`
>> to follow the common coding style where variables appear on the
>> left side of comparisons.
>> ---
>>  builtin/add.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/builtin/add.c b/builtin/add.c
>> index 0ee21692c2..ad0d6047af 100644
>> --- a/builtin/add.c
>> +++ b/builtin/add.c
>> @@ -432,7 +432,7 @@ int cmd_add(int argc,
>>  	argc--;
>>  	argv++;
>>  
>> -	if (0 <= addremove_explicit)
>> +	if ( addremove_explicit >= 0 )
> ... We also generally prefer the previous ordering there.

CodingGuidelines say that "We prefer a space between the function name and the parentheses, and no space inside the parentheses.".

It also says that "less stable value on the left hand side" and "textual order match the actual order of values" are both valid ways to write comparisons, and concludes "Just do not mix styles in the same part of the code and mimic existing styles in the neighbourhood."

And as you point out, I think this file prefers the "textual order matches actual order" style (there is only one violation of it in the file, if I counted correctly, in prune_directory()).

Many things in this patch contradicts the coding guidelines X-<. I wish if the vger mailing list can use some e-mail lint installed to bounce a patch e-mail that ignores our guides like CodingGuidelines and SubmittingPatches before it reaches the list to the author, with explanation.

Previous: Collin Funk
Message 3 of 3 in “Signed-off-by: aum2357 <ahambrahmasmi2357@gmail.com>”
  1. Signed-off-by: aum2357 <ahambrahmasmi2357@gmail.com>aum2357, Mar 13, 2026
  2. Collin FunkMar 13, 2026
  3. Junio C HamanoMar 13, 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.