git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Instructions concerning detached head lead to lost local changes

From
Junio C Hamano <junkio@cox.net>
Date
Feb 2, 2007, 01:41 UTC
Message-ID
<7v1wl9mj48.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<87mz3xa3vr.wl%cworth@cworth.org>
Carl Worth <cworth@cworth.org> writes:
Show 7 quoted lines
> At this point, I _knew_ that I didn't care about the state I was
> leaving, (it was something random that I had done for testing). So I
> definitely didn't want to name it with option (2).
>
> I also knew I hadn't done any commits while detached, which is what I
> thought the warning was all about. So I wasn't worried about losing
> nothing with option (1).

Well, the wording could probably be improved because you _did_ care about the state you were leaving (the "state" is not just what commit HEAD points at), but the suggestions did make it sound as if your had to choose between only these two, and neither would have worked for you.

> Can we fix this please?
The question is how.

We can admit that suggestions are just suggestions and listing only two is more confusing than not saying anything concrete.

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.
Previous: Linus TorvaldsNext: Carl Worth
Message 3 of 9 in “Instructions concerning detached head lead to lost local changes”
  1. Carl WorthFeb 1, 2007
  2. Linus TorvaldsFeb 1, 2007
  3. Junio C HamanoFeb 2, 2007
  4. Carl WorthFeb 2, 2007
  5. Carl WorthFeb 2, 2007
  6. Nicolas PitreFeb 2, 2007
  7. Theodore TsoFeb 2, 2007
  8. Nicolas PitreFeb 2, 2007
  9. Junio C HamanoFeb 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.