[PATCH] convert: support non annotated tags in git backend

Edouard Gomez ed.gomez at free.fr
Thu Mar 15 16:48:30 CDT 2012


On 15/03/2012 00:24, Bryan O'Sullivan wrote:
> Incidentally, do you happen to know why ls-remote is being used, and not
> show-ref? It makes no sense to me that we're querying a remote git
> repository here.

As Matt pointed out, it seems that ls-remote has been first used so that
refs would not be read directly from files. Seems logic to get rid of
implementation details as soon as some "porcelain" was available.

Apart from that, why ls-remote instead of show-ref ? I've no definite
answer as i'm a git noob. I just happen to fix git bugs I hit because i
really need to get my mercurial mirrors perfect :D.

But i have a theory that makes some sense.

I'd say the reason is that the local git repo may be poorly mirrored and
using ls-remote workarounds that. It happened to me lots of times before
i started adding a script around git/hg/svn/cvs in order to easily
mirror/convert to mercurial.

Let's say that the user mirrors through "git pull", in that case the
remote refs are not mirrored unless your active local branch has them in
their history. Using ls-remote prevents missing tags outside your active
branch if you happen to have commit objects on different branches
(originating from original clone i guess).

If the user mirrored the git repo correctly, using "git fetch -a -t"
(fetch all branches, and all tags, and do not update working checkout),
all remote tags would become local and both ls-remote and show-ref would
be equivalent. Of course in that later case, ls-remote has the "remote"
penalty.

-- 
Edouard Gomez


More information about the Mercurial-devel mailing list