Subject: Re: [PATCH 1/2] name-rev: wrap both blocks in braces

From: "Kristoffer Haugsbakk" <[email-masked]>
Date: Tue, 17 Mar 2026 23:10:11 +0100

On Sat, Mar 14, 2026, at 01:22, Junio C Hamano wrote:
> [email-masked] writes:
>
>> -		else if (++counter == hexsz &&
>> -			 !ishex(*(p+1))) {
>> +		} else if (++counter == hexsz &&
>> +			   !ishex(*(p + 1))) {
>>  			struct object_id oid;
>>  			const char *name = NULL;
>>  			char c = *(p+1);
>
> You are correcting "p+1" to "p + 1" to honor our coding style in a
> few lines above "while at it", but there are three others in the
> same block (we can see one of them in the post-context), which means
> these are now inconsistent.  Fixing all of them would make it a far
> larger change than qualifies as a "while at it" change.  Either make
> it another step that is an unrelated clean up, or leave it as-is.

Correct observation. clang-format got ahold of a few stray lines. But I
thought it only corrected the indentation, not that it also caught this
arithmetic formatting. I’ll remove it in the next version.

Thanks

>
> The primary thrust of this patch does make sense and is executed
> well.