Subject: Re: [PATCH] test-tool run-command: fix confusing init pattern

From: Junio C Hamano <[email-masked]>
Date: Fri, 10 Sep 2021 15:05:22 -0700

Ævar Arnfjörð Bjarmason <[email-masked]> writes:

>> The diff does too many things, some of which are your purely personal
>> preferences and do not actually need to be changed. This is a much more
>> to-the-point diff:
>
> We've been slowly converting everything to designated initializers. It
> seems to make sense to just do that if the line is being touched anyway.

Perhaps a preliminary clean-up patch is called for in such a case?

I do not think anybody can immediately see what the difference
between the old -1 and the new 0 in TESTSUITE_INIT macro means in
Dscho's alternative, but if we had a preliminary clean-up whose sole
change is to use designated initializers, the real "to-the-point"
step would become much easier to see which member that used to be
initialized to -1 is now getting zero-initialized.

And yes, changing the initializer style *and* the values the members
are initialized to in a same patch is much worse than sticking to
the style of the unreadable original.  It buries the real change in
the noise.

>>  #define TESTSUITE_INIT \
>> -	{ STRING_LIST_INIT_DUP, STRING_LIST_INIT_DUP, -1, 0, 0, 0, 0, 0, 0 }
>> +	{ STRING_LIST_INIT_DUP, STRING_LIST_INIT_DUP, 0, 0, 0, 0, 0, 0, 0 }