Re: [PATCH 3/3] Write index when populating empty untracked cache
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 24, 2022, 20:35 UTC
- Message-ID
- <xmqq5yp4knpa.fsf@gitster.g>
- In-Reply-To
- <CAPMMpogerttWdjGBNxJaqHT4bd3_igDx4_Fxev2eNHqexZ=aLQ@mail.gmail.com>
Tao Klerks <tao@klerks.biz> writes:
Show 6 quoted lines
>> The logic sounds fairly straight-forward. > > I didn't understand here whether you were confirming that the change > seems to make sense (yay!), or commenting that the extra comment block > is redundant, stating something obvious, and should better be removed. > Could you confirm please?
I meant the former when I wrote it.
But now you made me re-read the patch, I am becoming slightly sympathetic to the "do we even need to comment?" interpretation, too ;-)
The question is if the comment to these two statements is redundant.
if (!dir->untracked->root) {
/*
* If we've had to initialize the root, then what we had was an
* empty uninitialized untracked cache structure. We will be
* populating it now, so we should trigger an index write.
*/
FLEX_ALLOC_STR(dir->untracked->root, name, "");
istate->cache_changed |= UNTRACKED_CHANGED;
}I can be pursuaded either way.