From: Sean <seanlkml@sympatico.ca>
To: Linus Torvalds <torvalds@osdl.org>
Cc: junkio@cox.net, BjEngelmann@gmx.de, git@vger.kernel.org
Subject: Re: [PATCH 0/2] tagsize < 8kb restriction
Date: Tue, 23 May 2006 05:59:00 -0400 [thread overview]
Message-ID: <BAYC1-PASMTP07A0CAD58FB1CE30882F19AE9B0@CEZ.ICE> (raw)
Message-ID: <20060523055900.0dd845fd.seanlkml@sympatico.ca> (raw)
In-Reply-To: <Pine.LNX.4.64.0605221646540.3697@g5.osdl.org>
On Mon, 22 May 2006 17:02:41 -0700 (PDT)
Linus Torvalds <torvalds@osdl.org> wrote:
> That said, I think that what you actually want to do may be totally
> different.
>
> If _each_ commit has some extra information associated with it, you don't
> want to create a tag that points to the commit, you more likely want to
> create an object that is indexed by the commit ID rather than the other
> way around.
>
> IOW, I _think_ that what you described would be that if you have the
> commit ID, you want to find the data based on that ID. No?
Correct. But even though there isn't currently an efficient way to do
the reverse lookup, many of the visual tools do it. So for instance, if
you embed some metadata in the name of a tag, it will actually be nicely
shown to you associated with the proper commit in qgit/gitk/gitweb. So
you _can_ abuse tags and get modest results. And of course the low level
tools let you do.. git name-rev --tags to lookup the meta data as well.
So you can do git log | git name-rev --tags --stdin and see which tags
are associated with each commit.
I'm not arguing that this makes tags well designed for the these types
of things, just that there is no other option built in to the low level
git that comes as close.
> And that you can do quite easily, while _also_ using git to distribute the
> extra per-commit meta-data. Just create a separate branch that has the
> data indexed by commit ID. That could be as simple as having one file per
> commit (using, perhaps, a similar directory layout as the .git/objects/
> directory itself), and then you could do something like
>
> # Get the SHA1 of the named commit
> commit=$(git-rev-parse --verify "$cmitname"^0)
>
> # turn it into a filename (slash between two first chars and the rest)
> filename=$(echo $commit | sed 's:^\(..\)\(.*\):\1/\2:')
>
> # look it up in the "annotations" branch
> git cat-file blob "annotations:$filename"
>
> which gets the data from the "annotations" branch, indexed by the SHA1
> name.
>
> Now, everybody can track your "annotations" branch using git, and get your
> per-commit annotations for the main branch.
>
> See?
Sure, makes a lot of sense. Although the one file per commit thing doesn't
scale well. It's already a problem when trying to use a lot of tags for
instance.
More than the technical details of the implementation though, i'm trying to
make a case that git would do well to codify something like the above and
provide a _standard_ method of associating meta data with commits. This
would allow all the tools to start displaying meta data etc and have a
defined way to efficiently query and manipulate it.
Sean
next prev parent reply other threads:[~2006-05-23 10:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-22 14:48 [PATCH 0/2] tagsize < 8kb restriction Björn Engelmann
2006-05-22 19:18 ` Junio C Hamano
[not found] ` <20060522191240.1cb8c93f.seanlkml@sympatico.ca>
2006-05-22 23:12 ` Sean
2006-05-23 0:02 ` Linus Torvalds
[not found] ` <20060523055900.0dd845fd.seanlkml@sympatico.ca>
2006-05-23 9:59 ` Sean [this message]
2006-05-23 20:40 ` Björn Engelmann
2006-05-23 23:15 ` Junio C Hamano
2006-05-24 19:16 ` Björn Engelmann
2006-05-24 19:39 ` Junio C Hamano
2006-05-25 11:53 ` Björn Engelmann
2006-05-25 20:03 ` Junio C Hamano
2006-05-23 23:49 ` Junio C Hamano
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=BAYC1-PASMTP07A0CAD58FB1CE30882F19AE9B0@CEZ.ICE \
--to=seanlkml@sympatico.ca \
--cc=BjEngelmann@gmx.de \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=torvalds@osdl.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).