Re: Git/Mercurial interoperability (and what about bzr?)
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Nov 1, 2008, 12:26 UTC
- Message-ID
- <200811011326.25224.jnareb@gmail.com>
- In-Reply-To
- <87abcjpvy2.fsf@mid.deneb.enyo.de>
On Sat, 1 Nov 2008, Florian Weimer wrote:
Show 19 quoted lines
> * Jakub Narebski: >> Florian Weimer <fw@deneb.enyo.de> writes: >>> * Theodore Tso: >>> >>>> In the past I've looked at the possibility of creating a >>>> bi-directional, incremental gateway between hg and git repositories. >>>> The main thing which makes this difficult is that hg stores tags >>>> in-band inside the change-controlled .hgtags file. This means that if >>>> you cut a release, tag it, and then create a commit to further modify >>>> the repository, the new commit is descended from the tag commit, >>>> whereas in git, the tag is a "bookmark" --- perhaps signed via GPG, >>>> but not part of the revision history. >>> >>> Couldn't you just keep the .hgtags file and have everyone interested >>> in the tags use special scripts? >>> >>> (Admittedly, I'm horribly totally by Git's behavior in this area. I >>> haven't figured out yet under what circumstances tags are pushed and >>> pulled, so I'm not totally opposed to the Mercurial model. 8-/)
Show 8 quoted lines
>> Do you agree that global tags should be both non-versioned and >> trasferable? > > Yes, I do. In case of Git, I've got trouble with understanding how to > actually implement the "transferable" part with Git. The Mercurial > way is easier to understand, but it means that tags may need some sort > of "tag at this revision" qualifier to disambiguate, which is rather > problematic.
In first page of git-fetch(1):
When <refspec> stores the fetched result in tracking branches, the tags
that point at these branches are automatically followed. This is done by
first fetching from the remote using the given <refspec>s, and if the
repository has objects that are pointed by remote tags that it does not yet
have, then fetch those missing tags. If the other end has tags that point
at branches you are not interested in, you will not get them.You push tags explicitly (using "tag <tagname>" refspec, or specifying --tags, --all or --mirror, or setting it up in a config) in git.
Show 9 quoted lines
>> Now Mercurial has chosen to use in-tree '.hgtags' file to have global >> tags transferable. Never mind the fact that it had to treat this file >> in special way to have it non-versioned > > Oops, thought this file was versioned. Things like > > <http://tycoon.hpl.hp.com/changeset/932:931d181e9f58/.hgtags> > > suggest it was at some point.
It is half-versioned... :-X From what I remember of discussion on #revctrl and reading hgbok it is treated in special way: if you switch branches or rewind to some older version, .hgtags is always checked out the most recent version.
I don't know how Mercurial deals with situation where one reposityr added one tag, and other repository add other...
-- Jakub Narebski Poland