Re: [PATCH] Detached HEAD (experimental)
- From
Nicolas Pitre <nico@cam.org>
- Date
- Jan 10, 2007, 01:54 UTC
- Message-ID
- <Pine.LNX.4.64.0701092045090.4964@xanadu.home>
- In-Reply-To
- <20070110014000.GA30765@spearce.org>
On Tue, 9 Jan 2007, Shawn O. Pearce wrote:
Show 21 quoted lines
> Junio C Hamano <junkio@cox.net> wrote: > > Nicolas Pitre <nico@cam.org> 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 downSo 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