git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: Suggestion: superceded tags
Date: Thu, 26 May 2005 22:29:53 -0700	[thread overview]
Message-ID: <4296B051.10603@zytor.com> (raw)

It's a pretty fundamental concept in git that objects in the object 
repository live forever.  This is key to distribution, and is a good thing.

However, for tag objects, this is somewhat awkward.  It is occationally 
necessary to move a tag (restarted release processes, being one reason); 
purists tend to frown on it but it's reality.

It would be nice to maintain that all tag information exists in the 
object database and loss of the .git/refs directory will not harm that. 
  Thus, I'd like to suggest the following protocol:

When a tag is moved, a new tag object is created.  This tag object will 
have a "supercedes" header which references the old tag object.

Say, for example, that tag "klibc-1.0.14", object 
4695b4d163b62f6a9860b9bbe06ff30edb6e02be, exists with the following 
contents:

object fdb8a185ef261568f01140989745b8636212db71
type commit
tag klibc-1.0.14

Now "klibc-1.0.14" needs to be moved to new commit 
088c166af39b1ca2712667c44dccd3c7af99a8fb.

The new tag object should thus look like:

object 088c166af39b1ca2712667c44dccd3c7af99a8fb
type commit
supercedes 4695b4d163b62f6a9860b9bbe06ff30edb6e02be
tag klibc-1.0.14

(I put "supercedes" before "tag", because unfortunately the tag header 
terminates immediately after the "tag" line without having an 
intervening blank line.)

This will make it possible to move the tag, but still to recreate all 
tag information from the object database alone.

None of this can of course help the conflict if the same tag is created 
in different places by different people, and then they are trying to be 
merged.  The above at least makes it possible to distinguish the case of 
a tag conflict with the case of a moved tag, and in the case of the 
moved tag, will stand out.

On the other hand, it makes it possible for more than one tag to exist 
with the same name pointing to the same object:

User 1 creates tag X referring to object A	-> T1
User 1 moves tag X to object B			-> T2
User 2 creates tag X referring to object B	-> T3

There is no conflict here, but T2 and T3 will be different objects (one 
will supercede T1, and the other won't.)  An object-database-scanning 
program should observe that T2 and T3 are consistent, and T1 is 
superceded, therefore tag X is well-defined; it can arbitrarily use 
either instance T2 or T3.

	-hpa

             reply	other threads:[~2005-05-27  5:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-27  5:29 H. Peter Anvin [this message]
2005-05-27 11:26 ` Suggestion: superceded tags Stephen C. Tweedie
2005-05-27 16:10   ` H. Peter Anvin

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=4296B051.10603@zytor.com \
    --to=hpa@zytor.com \
    --cc=git@vger.kernel.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).