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

Re: [PATCH] tone down the detached head warning

From
Jeff King <peff@peff.net>
Date
Feb 1, 2007, 03:54 UTC
Message-ID
<20070201035450.GA2862@coredump.intra.peff.net>
In-Reply-To
<Pine.LNX.4.64.0701312238420.3021@xanadu.home>
On Wed, Jan 31, 2007 at 10:47:31PM -0500, Nicolas Pitre wrote:
> But this language convey the truth and users will have to get used to it 
> at some point. We should not hide the fact that HEAD is really detached at
> that point, otherwise it could be presumed that a commit might update the
> checked out (tracking) branch which is obviously not the case.

OK, so let's not lie about it, then. But that doesn't mean we can't explain further. What about:

$ git checkout origin/pu Detached your HEAD (based on remote origin/pu) -- you are not on any branch ...

Except that I think the line is getting a bit long. But the point is to explain _why_ we're detached (you could even put a different note for tags). If a user already knows that 'git checkout v1.4.4.4' is going to put him in a detached state, then he doesn't really care about the message one way or the other. But if he doesn't know (and there is no clue on the command line, except for the fact that we already know v1.4.4.4 is a tag and origin/pu is a remote tracking branch), then it might make it more why it happened.

-Peff
Previous: Nicolas PitreNext: Junio C Hamano
Message 15 of 35 in “tone down the detached head warning”
  1. tone down the detached head warningNicolas Pitre, Jan 31, 2007
  2. Jeff KingJan 31, 2007
  3. Jakub NarebskiJan 31, 2007
  4. Jeff KingJan 31, 2007
  5. Jakub NarebskiJan 31, 2007
  6. Carl WorthJan 31, 2007
  7. Jakub NarebskiFeb 1, 2007
  8. Andy ParkinsFeb 1, 2007
  9. Matthias LederhoferFeb 1, 2007
  10. Nicolas PitreFeb 1, 2007
  11. Jeff KingFeb 1, 2007
  12. Junio C HamanoFeb 1, 2007
  13. Jeff KingFeb 1, 2007
  14. Nicolas PitreFeb 1, 2007
  15. Jeff KingFeb 1, 2007
  16. detached HEAD -- finishing touchesJunio C Hamano, Feb 1, 2007
  17. Raimund BauerFeb 1, 2007
  18. Alex RiesenFeb 1, 2007
  19. Alex RiesenFeb 1, 2007
  20. git-checkout: disable guides how to switch branches with ui.guideMatthias Lederhofer, Feb 1, 2007
  21. Junio C HamanoFeb 1, 2007
  22. Matthias LederhoferFeb 1, 2007
  23. Junio C HamanoFeb 1, 2007
  24. Matthias LederhoferFeb 1, 2007
  25. Carl WorthFeb 1, 2007
  26. Nicolas PitreFeb 1, 2007
  27. Carl WorthFeb 1, 2007
  28. Jakub NarebskiFeb 1, 2007
  29. Theodore TsoFeb 1, 2007
  30. Junio C HamanoFeb 2, 2007
  31. Theodore TsoFeb 2, 2007
  32. Carl WorthFeb 2, 2007
  33. Junio C HamanoFeb 2, 2007
  34. Carl WorthFeb 2, 2007
  35. 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.