Subject: Re: [PATCH v5 2/3] gpg-interface: allow sign_buffer() to use default signing key

From: Justin Tobler <[email-masked]>
Date: Thu, 12 Mar 2026 15:24:34 -0500

On 26/03/12 01:20PM, Junio C Hamano wrote:
> Justin Tobler <[email-masked]> writes:
> 
> > -	return use_format->sign_buffer(buffer, signature, signing_key);
> > +	if (flags & SIGN_BUFFER_USE_DEFAULT_KEY && (!signing_key || !*signing_key))
> > +		signing_key = keyid_to_free = get_signing_key();
> 
> Micronit.
> 
> I would have preferred to see an extra pair of parentheses here, i.e.,
> 
> 	if ((flags & SIGN_BUFFER_USE_DEFAULT_KEY) &&
> 	    (!signing_key || !*signing_key))
>                     
> It would make it more obvious what two conditions are required to
> enter the body, even to those who well know the operator precedence
> rules between & and &&.

That's completely fair. I don't mind fixing and sending another version.

Thanks,
-Justin