I'd like for hg-git to supply a new command, something like git-tag, that adds a tag to the .hg/git-tags and then includes those tags when pushing to a git repository.
The issue with using simple Mercurial-style tags is that they're maintained in the Mercurial history, including references to Mercurial hashes which will only exist on that individual's checkout. Furthermore, hg-git won't pull the relevant git tags if there exists Mercurial tags by the same name, so hg-git checkouts of the git repository won't be able to see tags added in other hg-git checkouts until the .hgtags file is flushed.
Is there any reason to think that hg-git couldn't support creating git-style tags?
Edited
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
I also need this feature, simply because I'm using hg-git as a convenient way to work with Git repositories - one that doesn't require actually using the Git command line. The main drawback right now is tagging, creating a Git tag requires creating a Mercurial tag meaning adding a pointless .hgtags file to the Git repository.
So far I've created a small extension that extends the hg tag command and simply adds a line to .hg/git-tags if necessary. This is rather hacky as it ignores other parameters and doesn't reuse the code writing this file in the hg-git extension. But I could confirm that Git tags can be added and pushed this way. For reference, the code is:
import osfrom mercurial import commands, extensions, scmutildef tagwrapper(orig, ui, repo, *names, **opts): if opts.get('git'): rev = opts.get('rev', '.') rev = scmutil.revsingle(repo, rev).hex() with repo.opener('git-tags', 'a+', atomictemp=True) as file: for name in names: file.write("%s %s\n" % (rev, name)) else: orig(ui, repo, *names, **opts)extensions.wrapcommand(commands.table, 'tag', tagwrapper)options = commands.table['tag'][1]options.append(('', 'git', None, 'Create a Git-only tag'))