Re: [PATCH v3] show-branch: convert per-branch flags to commit-slab
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 15, 2026, 03:34 UTC
- Message-ID
- <xmqq1pd5q632.fsf@gitster.g>
- In-Reply-To
- <20260715015158.48559-1-gatlavishweshwarreddy26@gmail.com>
Gatla Vishweshwar Reddy <gatlavishweshwarreddy26@gmail.com> writes:
Show 13 quoted lines
> +static int show_independent(struct commit **rev, int num_rev)
> {
> int i;
>
> for (i = 0; i < num_rev; i++) {
> struct commit *commit = rev[i];
> - unsigned int flag = rev_mask[i];
> -
> - if (commit->object.flags == flag)
> + if (test_rev_flag_bit(commit, i))
> puts(oid_to_hex(&commit->object.oid));
> commit->object.flags |= UNINTERESTING;
> }These two perform different actions, do they not? The original code insists that the commit is reachable from only one tip (i.e., that the commit's flag word has only a single bit set, corresponding to the i-th revision). This is why the implementation does not use:
if (commit->object.flags & flag)
By contrast, the updated version merely checks whether the bit for the i-th revision is set, without verifying that all other bits are cleared.
Or am I misreading the patch?
Thanks.