From: Nicolas Pitre <nico@cam.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Carl Worth <cworth@cworth.org>, git@vger.kernel.org
Subject: Re: Instructions concerning detached head lead to lost local changes
Date: Thu, 01 Feb 2007 21:49:27 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.64.0702012135550.3021@xanadu.home> (raw)
In-Reply-To: <7v1wl9mj48.fsf@assigned-by-dhcp.cox.net>
On Thu, 1 Feb 2007, Junio C Hamano wrote:
> Alternatively we could add yet another suggestion that let's you
> discard the detached HEAD but still keep your local changes.
> Either --drop by Linus renamed to some sensible name, or "the
> obscure but useful trick".
>
> I dunno.
I have a feeling that proper reflog for HEAD would make the issue so
much simpler.
But in the mean time I tend to agree with Ted about the fact that simply
losing the detached position is not _that_ important. If you go to
HEAD^ and want to come back to master I think it should just work (with
a display of what the last position was as Carl mentioned).
It might be some work to get to a given position with a detached head
and this very position might be valuable information, but if you then do
"checkout HEAD^" you will still be detached but your previous position
is lost just like it would be if you moved to master. Yet you're not
prevented from going to HEAD^ but you are prevented from going to
master.
Same issue if you perform a commit on top of a detached head. Nothing
prevents you from doing "checkout HEAD^" which will leave your head
detached but it will also silently drop your last commit dangling.
In short I think there is no magic solution other than proper reflog for
HEAD.
Nicolas
next prev parent reply other threads:[~2007-02-02 2:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-01 22:51 Instructions concerning detached head lead to lost local changes Carl Worth
2007-02-01 23:49 ` Linus Torvalds
2007-02-02 1:41 ` Junio C Hamano
2007-02-02 2:00 ` Carl Worth
2007-02-02 2:06 ` Carl Worth
2007-02-02 2:49 ` Nicolas Pitre [this message]
2007-02-02 6:59 ` Theodore Tso
2007-02-02 7:14 ` Nicolas Pitre
2007-02-02 7:44 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0702012135550.3021@xanadu.home \
--to=nico@cam.org \
--cc=cworth@cworth.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).