From: Jeff King <peff@peff.net>
To: Mike Hommey <mh@glandium.org>
Cc: Johan Herland <johan@herland.net>, git@vger.kernel.org
Subject: Re: "git notes show" is orders of magnitude slower than doing it manually with ls-tree and cat-file
Date: Tue, 25 Nov 2014 23:46:42 -0500 [thread overview]
Message-ID: <20141126044642.GA15252@peff.net> (raw)
In-Reply-To: <20141126022553.GA16199@glandium.org>
On Wed, Nov 26, 2014 at 11:25:53AM +0900, Mike Hommey wrote:
> Now, looking at the notes tree reflog, I see that at some point, some
> notes were added at the top-level of the tree, without being nested,
> which is strange.
That's somewhat expected. The fanout is dynamic based on the number of
notes, so early on I think some notes may be found at the top of the tree.
> And it looks like it's related to how I've been adding them, through
> git-fast-import. I was using notemodify commands, and was using the
> filemodify command to load the previous notes tree instead of using the
> from command because I don't care about keeping the notes history.
> So fast-import was actually filling the notes tree as if it were
> starting over with whatever new notes were added with notemodify (which,
> in a case where there were many, it filled with one level of
> indirection)
Ah, that sort of makes sense. This confused the code to adjust the
fanout, because we track "number of notes" independently of "number of
files" (even though they are really the same thing in a notes tree).
> I'm not sure this is a case worth fixing in fast-import. I can easily
> work around it.
Yeah. Probably fast-import could be smarter here, but I think ultimately
it makes sense to stick to using the note commands. I think what you
want is a version of "from" that takes an existing tree (and number of
notes!) from a commit, but does not add it as a parent. AFAIK,
fast-import doesn't have a way to do that.
Probably the simplest thing is to build it with history via fast-import,
and then just truncate the history at the end with:
commit=$(echo "final notes tree" | git commit-tree refs/notes/foo^{tree})
git update-ref refs/notes/foo $commit
-Peff
next prev parent reply other threads:[~2014-11-26 4:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-26 0:42 "git notes show" is orders of magnitude slower than doing it manually with ls-tree and cat-file Mike Hommey
2014-11-26 1:00 ` Jeff King
2014-11-26 1:24 ` Jeff King
2014-11-26 1:34 ` Jeff King
2014-11-26 2:30 ` Mike Hommey
2014-11-26 4:49 ` Jeff King
2014-11-26 2:25 ` Mike Hommey
2014-11-26 4:46 ` Jeff King [this message]
2014-11-26 11:46 ` Johan Herland
2014-11-26 12:30 ` Mike Hommey
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=20141126044642.GA15252@peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=johan@herland.net \
--cc=mh@glandium.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;
as well as URLs for NNTP newsgroup(s).