git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: limiting git branch --contains
Date: Sat, 25 Mar 2023 02:30:35 -0400	[thread overview]
Message-ID: <20230325063035.GA562387@coredump.intra.peff.net> (raw)
In-Reply-To: <ZB4e/yE+25W66z6S@ugly>

On Fri, Mar 24, 2023 at 11:06:55PM +0100, Oswald Buddenhagen wrote:

> > Ah, that is your problem. When "replace" refs are in use, the data
> > stored in the commit-graph can't reliably be used. [...]
> > 
> why isn't the commit-graph built with the replaces applied (and tagged by a
> hash of the used replaces, so we know when to ignore it)?

I think a similar idea has come up before, but we decided to do the
simplest safe thing (disabling optimizations) to start with. And then
somebody who really cared about making optimizations work with commit
graphs could come along and do so later. Nobody has yet; you could be
that someone. ;)

> at minimum, i'd expect a warning giving a reason when the graph is ignored.

That might be reasonable. The commit graph is an optimization, so we'd
never produce a wrong answer by ignoring it. And since the fallback was
the status quo before the optimizations were implemented, it didn't seem
like that big a deal. But these days the performance many of us expect
is with those optimizations, so perhaps the tables have turned.

I do think there might be some complications, though. I think we may
build commit graphs by default these days during "gc" and even
incrementally after "fetch". If we warned when the graphs are disabled,
it basically means that every command in a repo with replace refs would
issue the warning.

> > I'd still be curious to see the
> > difference between "just commit graphs" and "commit graphs plus the
> > patch I showed earlier". I think it should make things faster, but if
> > it's only a few milliseconds on average, it's not that urgent to pursue.
> > 
> if there is a speed difference at all, it gets drowned out by the noise.

OK, thanks for testing. I do think that looking into a true single
traversal might make sense, but I don't think we've seen a case yet
where it's a substantial speedup.

-Peff

  reply	other threads:[~2023-03-25  6:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 18:54 limiting git branch --contains Oswald Buddenhagen
2023-03-23 19:42 ` Junio C Hamano
2023-03-23 20:44   ` Oswald Buddenhagen
2023-03-24 17:23     ` Derrick Stolee
2023-03-24 18:15       ` Oswald Buddenhagen
2023-03-24 18:20         ` Derrick Stolee
2023-03-24 19:02           ` Oswald Buddenhagen
2023-03-24 19:13             ` Jeff King
2023-03-24 19:58               ` Oswald Buddenhagen
2023-03-24 20:45                 ` Jeff King
2023-03-24 22:06                   ` Oswald Buddenhagen
2023-03-25  6:30                     ` Jeff King [this message]
2023-03-25  8:05                       ` Oswald Buddenhagen
2023-03-24 19:10       ` Jeff King
2023-03-23 20:56 ` Felipe Contreras

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20230325063035.GA562387@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=oswald.buddenhagen@gmx.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).