RFC: dealing with dead, anonymous feature branches

Martin Geisler mg at aragost.com
Mon May 17 08:57:17 CDT 2010


Augie Fackler <durin42 at gmail.com> writes:

> On May 17, 2010, at 3:10 AM, Martin Geisler wrote:
>
>> The core idea is simple: do not push/pull/clone dead branches.
>> 
>> I don't know if people will see this as just a halfhearted way of
>> supporting remove deletions, as if we couldn't figure out how to do a
>> "proper" server-side deletion.
>> 
>> I just tried to figure out how Git supports this. There you need to
>> push your branch name with a colon (?!) and others need to run a
>> prune command from what I can tell:
>> 
>>  http://github.com/guides/remove-a-remote-branch
>> 
>> I think the proposed solution would be more user friendly. We will
>> have to take care to warn users when they pull in a changesets that
>> causes the working copy parent changeset to be dead too.
>
> The git solution is rather different, as removing the branch from the
> repo means that all the changes that were referenced only by that
> branch get garbage collected, but that won't cause git to lose any tag
> information.

So Git wont garbage collect a changeset if it is referenced by a tag?
Seems quite sensible :-)

> We run the risk of losing tags if we stop transferring some branches.

I see... You must be talking about the situation where we have

  [A] --- [B] --- [T] --- [C]
             \
              [X] --- [Y] --- <Z>

and T is the changeset that adds a tag for Y and Z is dead. If I clone
this, I will only get A, B, T, and C and the .hgtags file will still
reference the unknown Y.

Perhaps this suggests that it is a very bad idea to make a tag on one
branch that refers to a changeset on another branch (again, "branch"
means topological branch here). The normal case where you do

  hg tag 1.0

to tag the current working copy parent revision works fine -- if you
have the tag, then you also have the changeset it refers to.

So can we forbid tags that "cross branches" like this?

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list