Re: [RFC PATCH 06/19] Factor ref updating out of fetch_with_import
From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:47:39
Heya, On Fri, Oct 30, 2009 at 17:04, Daniel Barkalow [off-list ref] wrote:
I think you have the sides backwards
Yup, sorry, got them the wrong way around for some reason.
On the other hand, I think it would make sense to use the same style of
refspec between the helper and transport-helper.c such that the helper
reports something like:
refs/svn/origin/trunk:refs/heads/trunkr
refs/svn/origin/branches/*:refs/heads/*
refs/svn/origin/tags/*:refs/tags/*
"list" gives:
000000...000 refs/heads/trunkr
"import refs/heads/trunkr" imports the objects, but the refspecs have to
be consulted by transport-helper.c in order to determine what ref to read
to get the value of refs/heads/trunkr. Instead of getting the value with
read_ref("refs/heads/trunkr", ...) like it does now, it would do
read_ref("refs/svn/origin/trunk", ...). And systems like p4 that don't
have a useful standard just wouldn't support the "refspec" command and
people would have to do site-specific configuration to get anything
useful.Yes, that sounds very reasonable, and I think that's the right way to go. This leaves us with only one thing, we need a remote HEAD for 'git clone hg::/path/to/repo' to work and have it check out a branch, I think a seperate 'head' command might be appropriate? If supported it returns the which local symref (e.g. 'refs/heads/trunkr' in the svn case) should be pointed at by HEAD. If not supported we can just not set it and clone will give the default 'no remote HEAD, nothing checked out' message, which would probably be best for p4? -- Cheers, Sverre Rabbelier