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
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Aug 15, 2023, 22:59 UTC
- Message-ID
- <CAOLa=ZTXjV3abbuLYF8oE3P_P_xSZUtyM4fpPSg55Dd_QXoWXQ@mail.gmail.com>
- In-Reply-To
- <ZNv3+xOCi920StXO@nand.local>
On Wed, Aug 16, 2023 at 12:11 AM Taylor Blau <me@ttaylorr.com> wrote:
Show 33 quoted lines
> > 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
Thanks! I tried using bitmap traversal and can confirm the issue doesn't exist with this option.