git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: Thomas Ferris Nicolaisen <tfnico@gmail.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: commit-graph idea: warn when disabled for incompatible repositories
Date: Tue, 18 Dec 2018 09:35:13 -0500	[thread overview]
Message-ID: <b74bab07-dd77-5195-aaee-a324e9a6b824@gmail.com> (raw)
In-Reply-To: <CAEcj5uXJC3Za0YCyazJi82JdF-tLCDs5OrzCwyD8Y155GnJa6Q@mail.gmail.com>

On 12/18/2018 9:22 AM, Thomas Ferris Nicolaisen wrote:
> Hey there,

Hi, Thomas!

> Accidentally, my first use-case was a local copy of a big repository
> (chromium source) that another developer had cloned shallow (I wasn't
> even aware of their clone being shallow at that point).
>
> After spending a little time trying to figure out why no commit-graph
> file was being created, I noticed that it worked just fine testing in
> a fresh git repo.
>
> Then I discovered the .git/shallow file in the big repo. So I did
> fetch --unshallow, and commit-graph started working. Taking a 20
> second log --graph operation down to less than a second (wooo!).
>
> I saw some recent release notes that mentions that commit-graph is
> disabled in incompatible repositories (graft, replace). I assume this
> also be the case for shallow clones.

The commit-graph feature is not designed to work well with these 
features, and the "easy" fix we have so far is to completely avoid the 
interaction. The tricky bits come in when the commit parents can 
"change" according to these other features. The commit-graph would need 
to change at the same time, and this is actually very difficult to get 
correct.

> Here's the idea that may help others on the same path: Some warning
> output when attempting to use commit-graph when it is disabled (either
> by configuration or automatically).
>
> I think others that come across commit-graph may have tried such
> tricks (like shallow clones) to better work with their repositories,
> and it could be frustrating that commit-graph has no apparent effect.

This is a good idea, and I would happily review a patch that added such 
a warning.

The warning would want to be in builtin/commit-graph.c, and use the 
commit_graph_compatible() method from commit-graph.c. (You'll need to 
expose the method in the .h file.)

Thanks!

-Stolee


  reply	other threads:[~2018-12-18 14:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 14:22 commit-graph idea: warn when disabled for incompatible repositories Thomas Ferris Nicolaisen
2018-12-18 14:35 ` Derrick Stolee [this message]
2018-12-18 18:21   ` Ævar Arnfjörð Bjarmason
2018-12-18 19:07     ` Derrick Stolee

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=b74bab07-dd77-5195-aaee-a324e9a6b824@gmail.com \
    --to=stolee@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=tfnico@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.
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).