Re: git clone (ssh://) skips detached HEAD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2 Jun 2011, Jeff King wrote:
> On Wed, Jun 01, 2011 at 03:42:58PM -0700, Jakub Narebski wrote:
> 
> > > The reason is that the default refspec on clone is:
> > > 
> > >   $ git config remote.origin.fetch
> > >   +refs/heads/*:refs/remotes/origin/*
> > > 
> > > And HEAD is not under refs/heads/.
> > 
> > Hmmm... HEAD is a bit of special case, as HEAD should really land in
> > refs/remotes/origin/HEAD from what I understand.
> 
> No, that is always supposed to be a symbolic ref. Making it a real ref
> would be confusing. I don't think fetch should look at HEAD at all; it's
> outside its refspec. However, clone does treat HEAD specially, and
> should probably convert the remote's detached HEAD into a local detached
> HEAD (we already do if it's part of referenced history).

Hmmm... in ordinary case (not on detached HEAD) "git fetch" would never
modify my local branches nor my local HEAD.  On the other hand IIRC
origin/HEAD do not follow switching branches at origin, and is staying
at the value at clone (or "git remote set-head"), isn't it?  

So what to do when HEAD on origin is detached?  Modify .git/HEAD,
or maybe .git/refs/remotes/origin/HEAD?

-- 
Jakub Narebski
Poland
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]