Re: [RFC PATCH 06/19] Factor ref updating out of fetch_with_import
- From
Sverre Rabbelier <srabbelier@gmail.com>
- Date
- Oct 30, 2009, 12:57 UTC
- Message-ID
- <fabb9a1e0910300557x42d3612pf7e83907e91efdc9@mail.gmail.com>
- In-Reply-To
- <alpine.LNX.2.00.0910300221290.14365@iabervon.org>
On Fri, Oct 30, 2009 at 00:10, Daniel Barkalow <barkalow@iabervon.org> wrote:
Show 7 quoted lines
> Actually, I think the problem is that builtin-clone will always default to > setting up a refspec of "refs/heads/*:refs/remotes/origin/*", but that > doesn't actually make any sense if the source repository isn't presented > as having refs names like "refs/heads/*". The immediate problem that you > don't get HEAD because it's a symref to something outside the pattern is > somewhat secondary to the general problem that you don't get anything at > all, because everything's outside the pattern.
Ah, I didn't realize that as long as HEAD is a symref to something in refs/heads/* it would be fetched.
Show 7 quoted lines
> I don't really think that presenting the real refs in refs/<vcs>/*, and > having the list give symrefs to them from refs/heads/* and refs/tags/* > really makes sense; I think it would be better to rework fetch_with_import > and the list provided by a foreign vcs helper such that it can present > refs with normal names (refs/heads/*, refs/tags/*, etc) if the foreign vcs > has standards that correspond to branches and tags. Then "clone" would > work normally.
Perhaps we could introduce an additional phase before import to set the default refspec? If we could tell git that we want "refs/heads/*:refs/hg/origin/*" before line 468 "if (option_bare) {", that would save us a lot of trouble. Does that sound like a good idea? It would mean we have to move the transport_get part up a bit, but I don't think that will be a problem. A svn helper for example might respond the following to the "refspec" command: "refs/heads/trunkr:refs/svn/origin/trunk" "refs/tags/*:refs/svn/origin/tags/*" "refs/heads/*:refs/svn/origin/branches/*"
How does that sound?
-- Cheers, Sverre Rabbelier