Re: [PATCH] Proof-of-concept patch to remember what the detached HEAD was

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

 



On Thu, 15 Oct 2009, Daniel Barkalow wrote:

> On Thu, 15 Oct 2009, Junio C Hamano wrote:
> 
> > Daniel Barkalow <barkalow@xxxxxxxxxxxx> writes:
> > 
> > >  $ git checkout origin/master
> > >  $ git fetch
> > >  $ git checkout origin/next
> > >  Uncommited file '...' would be overwritten.
> > >
> > > If HEAD is a symref to refs/remotes/origin/master, and you update 
> > > refs/remotes/origin/master, git will subsequently see that your index 
> > > doesn't match HEAD, and when you switch branches, it will try to apply a 
> > > revert to the branch you're switching to. It's the same issue as pushing 
> > > into a non-bare repository.
> > 
> > I think the idea here is to allow HEAD to point at outside refs/heads/,
> > e.g. refs/remotes/origin/master, but forbid commit and other commands from
> > updating HEAD and its underlying ref via update_ref() unless HEAD is
> > detached or points at a local branch.
> 
>  $ git checkout origin/master
>  $ git fetch
>  (Some error)

Right.

So we're back to your initial proposal I guess (storing some info/state 
in .git/HEAD when detached).


Nicolas
--
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]