Re: [GSoC PATCH v5 5/5] repo: add the --format flag
From: Ben Knoble <hidden>
Date: 2025-07-29 00:38:50
Le 28 juil. 2025 à 20:27, Eric Sunshine [off-list ref] a écrit : On Mon, Jul 28, 2025 at 8:15 PM Ben Knoble [off-list ref] wrote:quoted
quoted
quoted
Le 27 juil. 2025 à 18:02, Eric Sunshine [off-list ref] 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.quoted
(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.