git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Sam Vilain <sam@vilain.net>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org
Subject: Re: What's cooking in git.git (Jan 2009, #05; Wed, 21)
Date: Sat, 31 Jan 2009 02:36:40 -0500	[thread overview]
Message-ID: <20090131073640.GF3033@coredump.intra.peff.net> (raw)
In-Reply-To: <1233384354.10045.170.camel@maia.lan>

On Sat, Jan 31, 2009 at 07:45:54PM +1300, Sam Vilain wrote:

> Is there any reason why the split has to be cast in stone at all?
> 
> ie, the code could just scan the root tree of the branch, and
> progressively descend into sub-trees based on a partial match of the
> object for which the note is to be found.  If you find a partial name
> then you expect that it is a tree and descend into it and scan for the
> rest.  If you find a complete name then you expect that it is a blob and
> open it.  If it turns out to be a tree then there are multiple notes for
> that commit.  Then I think you get the best of both worlds; you can
> start with a simple flat structure and then later someone can come along
> and make it split it when there are more than N entries in the root tree
> (where N is determined from profiling etc).

Actually, lookup is even easier than that: we iterate through the entire
tree recursively and add everything to a flat hash. So we really don't
care there what the layout is like (just take the first 40 characters of
any directory name as a hash).

But it violates the usual git principle of "content has a unique name".
What happens when I add "a/b" and you add "ab"? A dumb merge will let
both co-exist, but which one do you return for lookup?

> One would be to allow grafts to be noted.  These might want to live in a
> different place to refs/notes/commits, like refs/notes/grafts, to avoid
> performance issues and to recognise they are a different type of data.
> A second would be for commit header information - particularly the
> author field and commit description - to be amended.  I think this all
> belongs under refs/notes/commits.  These are in essence, historical
> corrections that don't need to alter the tree.

I agree that there should be multiple note hierarchies, and multiple
keys within each hierarchy. I have posted some thoughts on that before
(and you should be able to find them searching for "notes" in the list
archive), but unfortunately I have not had time to sit down and really
work out a notes implementation that matches what I posted (which I
don't think is that far from Dscho's work in next).

And I think what you are proposing (here and in the rest of your
message) is that certain notes hierarchies may have particular formats
and semantics. And that sounds reasonable to me.

-Peff

  reply	other threads:[~2009-01-31  7:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22  3:55 What's cooking in git.git (Jan 2009, #05; Wed, 21) Junio C Hamano
2009-01-22  4:26 ` Jeff King
2009-01-22  5:57   ` [PATCH v2 1/5] Windows: Fix signal numbers Jeff King
2009-01-22  5:59   ` [PATCH v2 2/5] diff: refactor tempfile cleanup handling Jeff King
2009-01-22  6:02   ` [PATCH v2 3/5] chain kill signals for cleanup functions Jeff King
2009-01-30  7:55     ` Jeff King
2009-01-30  8:13       ` Johannes Sixt
2009-01-30  8:21         ` Jeff King
2009-01-31  0:28           ` Junio C Hamano
2009-01-31  1:44             ` Jeff King
2009-01-31  6:50               ` Jeff King
2009-02-01  1:58                 ` Junio C Hamano
2009-01-22  6:03   ` [PATCH v2 4/5] refactor signal handling " Jeff King
2009-01-22  6:03   ` [PATCH v2 5/5] pager: do wait_for_pager on signal death Jeff King
2009-01-22  5:13 ` What's cooking in git.git (Jan 2009, #05; Wed, 21) Johannes Schindelin
2009-01-31  6:45   ` Sam Vilain
2009-01-31  7:36     ` Jeff King [this message]
2009-02-01  2:39       ` [PATCH] split notes [was: Re: What's cooking in git.git (Jan 2009, #05; Wed, 21)] Sam Vilain
2009-02-01  3:09       ` Sam Vilain
2009-02-01 12:01         ` Jakub Narebski
2009-01-22  5:21 ` What's cooking in git.git (Jan 2009, #05; Wed, 21) Boyd Stephen Smith Jr.
2009-01-23  6:23   ` Junio C Hamano
2009-01-27  1:43   ` Boyd Stephen Smith Jr.

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=20090131073640.GF3033@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sam@vilain.net \
    /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).