Re: [PATCH v2 07/15] rev-list: allow bitmaps when counting objects
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 16, 2020, 23:36 UTC
- Message-ID
- <xmqqsgjam7e2.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20200215065500.GC1633703@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 21 quoted lines
>> > + uint32_t commit_count = 0, >> > + tag_count = 0, >> > + tree_count = 0, >> > + blob_count = 0; >> >> Hmm, I don't usually see the comma-separated declaration/initialization >> in git.git. Is there a reason you did it here? Not that I really mind >> one way or the other, just interested. > > The variables are all related, and all should have the same type. I'd > complain about a patch that did: > > int ret, count; > > because there's no logical reason those two variables have the same > type. They just happen to. And putting them both on the same line is > even worse, because it makes a diff changing one of them noisy. > > But in the code quoted above, if one of them changes, they would all > (presumably) change. So I think it communicates something to group them > like this.
I often apply exactly the same criteria as above to my code and review---since it is not just you (or me), perhaps CodingGuideline can help other readers, but I am OK to delay documenting it until we find the third person who has been applying this rule that has not been spelt out explicitly ;-)