Re: [PATCH] Detached HEAD (experimental)

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

 



On Tue, 9 Jan 2007, Shawn O. Pearce wrote:

> Junio C Hamano <junkio@xxxxxxx> wrote:
> > Nicolas Pitre <nico@xxxxxxx> writes:
> > 
> > >> Unfortunately .git/logs/HEAD wouldn't be created by default as its
> > >> not under refs/heads or refs/remotes.  Though it could be made to be
> > >> on by default, in which case it would only log changes while HEAD
> > >> is detached.  If HEAD is attached to a branch then .git/logs/HEAD
> > >> wouldn't be appended to (or even created), while the branch's own
> > >> log is still appended to.
> > >
> > > Is this worth the trouble and complexity?  After all detached heads are 
> > > not meant to be used for serious development.
> > 
> > I agree.
> 
>   git checkout v1.4.0
>   # dang, need some local fix
>   git commit -m tmpfix -a
>   git reset --hard v1.2.0
>   git reset --hard v1.3.0
>   # dang, need that local again fix - where is it?

    cd /
    ls
    # wow lots of files
    rm -rf .
    # dang dunk down

So just don't use git-reset but create a branch to preserve that local 
change instead.

> It ain't in ORIG_HEAD.  Its now only findable by
> fsck-objects/lost-found.

Which is good enough in that circumstance IMHO.  We cannot always try to 
prevent people from shooting in their foot if they really want to.

> But if you reflog a detached
> HEAD its there as HEAD@{2}.

But when your head is not detached anymore then HEAD@{2} changes 
meaning and that is rather not good.


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]