git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Petr Baudis <pasky@suse.cz>, Tom Prince <tom.prince@ualberta.net>,
	git@vger.kernel.org
Subject: Re: Cogito: cg-clone doesn't like packed tag objects
Date: Wed, 28 Sep 2005 10:22:07 -0700	[thread overview]
Message-ID: <7virwlumyo.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0509271414000.3308@g5.osdl.org> (Linus Torvalds's message of "Tue, 27 Sep 2005 14:16:12 -0700 (PDT)")

Linus Torvalds <torvalds@osdl.org> writes:

>> we could send phony entries like this:
>> 
>> b92c9c07fe2d0d89c4f692573583c4753b5355d2	deref/tags/junio-gpg-pub
>> a3eb250f996bf5e12376ec88622c4ccaabf20ea8	deref/tags/v0.99
>> 78d9d414123ad6f4f522ffecbcd9e4a7562948fd	deref/tags/v0.99.1
>
> Yes, it would work,..
> in general, it's just a really ugly special case, I think.

I think we could do this instead, to make it less ugly.

b92c9c07fe2d0d89c4f692573583c4753b5355d2	refs/tags/junio-gpg-pub!*
a3eb250f996bf5e12376ec88622c4ccaabf20ea8	refs/tags/v0.99^0

I am not sure what the syntax should be, but the idea is to
express the "refname" side using "extended SHA1" syntax.  In the
above example, I added a postfix '!*' to mean "deref tag
zero-or-more times until you get a non-tag" ('!' to mean deref
tag once and complain if the object is not tag, '!!' is deref
twice, '!!!' is to deref three times and so on).  It might be
better to spell "v0.99^0" as "v0.99!*" in this context. [*1*]

Both git-clone-pack and git-fetch-pack need to be told to ignore
funny tagnames with trailing '!*', otherwise they would ask for
the pointed-at object (which is not harmful but redundant) and
the clone would create "refs/tags/v0.99!*", a file with a funny
name.  Git-peek-remote should report that, and server-info.c
should be told to prepare these extra entries for ls-remote over
other protocols.

But I tend to agree that this is really a special case needed to
support the "tagged objects are automatically followed by tags
that tag them" model, and not needed if we stay in "tag is just
a ref, and a ref is just an object name, and asking for an
object pulls in other objects that are reachable from them"
model.  So it is not a very high priority for me, but I think
this is one way to help Cogito cleanly, and I am willing to see
how much damage this would cause to other parts of the core, *if*
Cogito wants to use this mechanism.

The alternative would be what Pasky outlined in his message --
bypassing git transport layer to fetch single object by hand,
repeatedly dereferencing it until he gets a non-tag.  I think
that is unnecessary misery for him.


[Footnote]

*1* The difference from '^0' is that '!' does not complain on
non-commit, and can be used to peel the onion one layer at a
time.  I do not know how useful the latter is in practice but
somebody may want to express chains of trust by signing tags.

  parent reply	other threads:[~2005-09-28 17:23 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-23 22:24 Cogito: cg-clone doesn't like packed tag objects H. Peter Anvin
2005-09-24  1:18 ` Petr Baudis
2005-09-24  1:52   ` H. Peter Anvin
2005-09-24  2:00   ` Junio C Hamano
2005-09-24 12:50     ` Petr Baudis
2005-09-24 17:13       ` Daniel Barkalow
2005-09-24 18:10       ` Junio C Hamano
2005-11-09 22:33         ` Petr Baudis
2005-11-09 23:14           ` Junio C Hamano
2005-11-09 23:36             ` Nick Hengeveld
2005-11-09 23:44               ` Petr Baudis
2005-11-10  1:01                 ` Nick Hengeveld
2005-11-09 23:47               ` Junio C Hamano
2005-09-26 21:25   ` Petr Baudis
2005-09-26 21:55     ` Brian Gerst
2005-09-26 21:56       ` Petr Baudis
2005-09-26 22:23     ` Junio C Hamano
2005-09-26 22:29       ` Petr Baudis
2005-09-27  4:46         ` Junio C Hamano
2005-09-27  5:02           ` Tom Prince
2005-09-27  5:28             ` Junio C Hamano
2005-09-27  9:40               ` Petr Baudis
2005-09-27 10:14                 ` Josef Weidendorfer
2005-09-27 12:34                   ` Petr Baudis
2005-09-27 13:27                     ` Josef Weidendorfer
2005-09-27 17:07                 ` Junio C Hamano
2005-09-27 17:56                   ` Linus Torvalds
2005-09-27 18:36                     ` Junio C Hamano
2005-09-27 21:16                       ` Linus Torvalds
2005-09-27 21:44                         ` Linus Torvalds
2005-09-27 22:11                         ` Junio C Hamano
2005-09-28 17:22                         ` Junio C Hamano [this message]
2005-10-14  6:03                           ` Peeling the onion Junio C Hamano
     [not found]                             ` <46a038f90510140048r30c7ec36n35f77a1ac52c4691@mail.gmail.com>
2005-10-14  8:40                               ` Junio C Hamano
2005-09-26 22:37       ` Cogito: cg-clone doesn't like packed tag objects Junio C Hamano
2005-09-27  6:54     ` Sven Verdoolaege
2005-09-27  7:25     ` Ryan Anderson
2005-09-27 15:34       ` Linus Torvalds
2005-09-27 17:34         ` Ryan Anderson
2005-09-27 18:04           ` Linus Torvalds
2005-09-27  7:46     ` 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=7virwlumyo.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=pasky@suse.cz \
    --cc=tom.prince@ualberta.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).