git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Karthik Nayak <karthik.188@gmail.com>, git@vger.kernel.org
Subject: Re: [Bug] In `git-rev-list(1)`, using the `--objects` flag doesn't work well with the `--not` flag, as non-commit objects are not excluded
Date: Tue, 15 Aug 2023 18:11:07 -0400	[thread overview]
Message-ID: <ZNv3+xOCi920StXO@nand.local> (raw)
In-Reply-To: <xmqqttt0hzl2.fsf@gitster.g>

On Tue, Aug 15, 2023 at 12:31:37PM -0700, Junio C Hamano wrote:
> Karthik Nayak <karthik.188@gmail.com> writes:
>
> > If you notice here, the objects
> > `8baef1b4abc478178b004d62031cf7fe6db6f903`,
> > `086885f71429e3599c8c903b0e9ed491f6522879` and
> > `7a67abed5f99fdd3ee203dd137b9818d88b1bafd` are included in the output,
> > these objects are reachable from
> > `91fa9611a355db77a07f963c746d57f75af380da` and shouldn't have been
> > included since we used the `--not` flag.
>
> For performance reasons, we cannot afford to enumerate all objects
> that are reachable from --not objects and exclude them from the
> output.  So it is a balancing act to decide where to draw the line.

As a hack, you can exploit the existing bitmap traversal routine to
build up an exact mapping of what is and isn't on either side of your
reachability query.

IOW, if you run:

    git repack -ad --write-bitmap-index

and then repeat the rev-list query with `--use-bitmap-index`, you should
get exact results.

Note that this will only work if pack.useBitmapBoundaryTraversal is set
to false, since the boundary-based traversal that is behind that
configuration option is susceptible to the same one-sided error.

Thanks,
Taylor

  reply	other threads:[~2023-08-15 22:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15 16:44 [Bug] In `git-rev-list(1)`, using the `--objects` flag doesn't work well with the `--not` flag, as non-commit objects are not excluded Karthik Nayak
2023-08-15 19:31 ` Junio C Hamano
2023-08-15 22:11   ` Taylor Blau [this message]
2023-08-15 22:59     ` Karthik Nayak
2023-08-15 22:56   ` Karthik Nayak
2023-08-16 18:24     ` Junio C Hamano
2023-08-16 20:58       ` Karthik Nayak
2023-08-15 20:52 ` [Bug???] " 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=ZNv3+xOCi920StXO@nand.local \
    --to=me@ttaylorr.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karthik.188@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).