Subject: Re: [GSoC PATCH v5 5/5] repo: add the --format flag

From: Ben Knoble <[email-masked]>
Date: Mon, 28 Jul 2025 20:38:39 -0400

> Le 28 juil. 2025 à 20:27, Eric Sunshine <[email-masked]> a écrit :
> 
> On Mon, Jul 28, 2025 at 8:15 PM Ben Knoble <[email-masked]> wrote:
>>>> Le 27 juil. 2025 à 18:02, Eric Sunshine <[email-masked]> a écrit :
>>> Simpler:
>>>   printf "$expected_value\0" >expected &&
>> 
>> (Below as well): the shell linter I use does prefer to see
>> 
>>    printf %s\\0 "$var"
>> 
>> to avoid issues with the variable containing format specifiers.
> 
> That's a very good point about using "%s"; I should have suggested
> that myself. Thanks for the correction.
> 
>> (Backslash has to be quoted in double-quotes, too, I think? So I left out the quotes here.)
> 
> No, backslash does not need to be escaped in double-quotes. The
> literal form `printf "%s\0"` is common enough in Git test scripts, so,
> for consistency, that should be the form we recommend in reviews, not
> the form lacking quotes, I'd think.

Right; on second thought, shell quotes (mostly) don’t nest like that. Thanks for the catch.