Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Gatla Vishweshwar Reddy <gatlavishweshwarreddy26@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3] show-branch: convert per-branch flags to commit-slab
Date: Tue, 14 Jul 2026 20:34:09 -0700	[thread overview]
Message-ID: <xmqq1pd5q632.fsf@gitster.g> (raw)
In-Reply-To: <20260715015158.48559-1-gatlavishweshwarreddy26@gmail.com> (Gatla Vishweshwar Reddy's message of "Wed, 15 Jul 2026 07:17:22 +0530")

Gatla Vishweshwar Reddy <gatlavishweshwarreddy26@gmail.com> writes:

> +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.

  reply	other threads:[~2026-07-15  3:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 18:30 [PATCH] show-branch: convert object.flags usage to a commit-slab Gatla Vishweshwar Reddy
2026-07-14 20:01 ` [PATCH v2] show-branch: convert object.flags to commit-slab with uint64_t Gatla Vishweshwar Reddy
2026-07-14 20:41   ` Junio C Hamano
2026-07-14 22:00     ` Jeff King
2026-07-15  1:47       ` [PATCH v3] show-branch: convert per-branch flags to commit-slab Gatla Vishweshwar Reddy
2026-07-15  3:34         ` Junio C Hamano [this message]
2026-07-15  4:18           ` [PATCH v4] " Gatla Vishweshwar Reddy
2026-07-15  6:47             ` Patrick Steinhardt
2026-07-15  7:20         ` [PATCH v3] " Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq1pd5q632.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=gatlavishweshwarreddy26@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox