Re: Complete http-pull; where should it go?
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- May 2, 2005, 02:43 UTC
- Message-ID
- <Pine.LNX.4.58.0505011932220.2162@ppc970.osdl.org>
- In-Reply-To
- <7v4qdmqt8v.fsf@assigned-by-dhcp.cox.net>
On Sun, 1 May 2005, Junio C Hamano wrote:
> > That's why I said I do not think this belongs to the Plumbing.
I've removed the ugly parent format, but to make it easier to script the thing I removed, I just pushed out an improvement to "cat-file" which makes it use the "read_object_with_reference()" helper to cat the object.
That means that if you use "git-cat-file tree" on a tag object, then it will first look up the tag object, then the commit object and finally the tree obejct, and it will cat that tree object. Of course, normally you'd use it with a "commit" object and get the pleasure of having it "just work" with tags too.
So for example, to get the parent of a commit (whether a tag that points to a commit, or a real commit), you'd script something like
git-cat-file commit v2.6.12-rc3 | sed -n '/^parent /{s/parent //;p;q}'which gets the first parent of the commit that was pointed to by the "v2.6.12-rc3" tag.
If you want to see the tag itself, you'd just do
git-cat-file tag v2.6.12-rc3
like before, of course.
And "git-cat-file -t" always gives the top-level tag, so if you ask the type of "v2.6.12-rc3" it will say "tag".
Linus