From: Junio C Hamano Date: Tue, 21 Jan 2025 22:10:14 GMT Subject: Re: [PATCH v2] t8002: fix ambiguous printf conversion specifications Message-ID: In-Reply-To: <20250120114106.2844157-1-jpalus@fastmail.com> Jan Palus writes: > - $(printf "%0.s " $(test_seq 11)) ( 2005-04-07 15:45:13 -0700 1) abbrev > + $(printf "%11s" "") ( 2005-04-07 15:45:13 -0700 1) abbrev This obviously is much clearer than the obscure original that concatenates " " 11 times (for 11 arguments that printf receives). Nice. > @@ -146,7 +146,7 @@ test_expect_success 'blame --abbrev -b truncates the blank boundary' ' > > test_expect_success 'blame with excessive --abbrev and -b culls to hash length' ' > cat >expect <<-EOF && > - $(printf "%0.s " $(test_seq $hexsz)) ( 2005-04-07 15:45:13 -0700 1) abbrev > + $(printf "%${hexsz}s" "") ( 2005-04-07 15:45:13 -0700 1) abbrev The fact that $hexsz was not quoted in the original made me look at how it is defined (as an unquoted variable reference is often a way to lose unwanted leading whitespaces, e.g. bytes=$(wc -c