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

Re: Difficulties in advertising a new branch to git newbies

From
Junio C Hamano <junkio@cox.net>
Date
Jan 31, 2007, 20:20 UTC
Message-ID
<7vhcu7uewe.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070131170752.GA19527@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> On Wed, Jan 31, 2007 at 09:59:08AM -0500, Nicolas Pitre wrote:
>
>> Also the warning when moving to a detached head is useful to make the 
>> user aware of what just happened because there is really something 
>> special about such checkout.  It is not meant to frighten users and if 
>> it does so then maybe it should be reworked some more.  But IMHO it is 
>> important that the user be aware of this special state.
>
> What is so special about it? My argument is that it is not really very
> special _until you make commits_. Are there other operations which we
> should be warning people about if they have a detached head?

I think you (and others in the thread) are forgetting that moving to a particular state by resetting can create a state that you may want to keep a pointer to, but you do not have any existing ref. That's one of the reasons why we do not merely check if the detached HEAD is not reachable from any of the existing refs when coming back. Instead, we check and warn if the detached HEAD does not exactly match one of the existing refs.

Imagine "git bisect" did not exist, or was not powerful enough, and the user was doing it by hand using something other than "git bisect" to guide him which state to go next, or the user did not want to use the special "bisect" branch, or some combination of the above. You move your detached HEAD around and finally you are at the commit you are interested in. You haven't marked it in some way (perhaps "git tag") yet. You haven't made any commit, and the commit is reachable in some way, but all the work to reach that state will be lost unless you jot its commit object name down somewhere.

So "until you make commits" is not sufficient, which means that covering all the way you can make commits isn't, either.

Previous: Jeff KingNext: Theodore Tso
Message 17 of 50 in “Difficulties in advertising a new branch to git newbies”
  1. Carl WorthJan 30, 2007
  2. Jakub NarebskiJan 30, 2007
  3. Yann DirsonJan 30, 2007
  4. Jakub NarebskiJan 30, 2007
  5. Junio C HamanoJan 30, 2007
  6. Jakub NarebskiJan 30, 2007
  7. Matthias LederhoferJan 30, 2007
  8. Matthias LederhoferJan 30, 2007
  9. Jeff KingJan 30, 2007
  10. Junio C HamanoJan 31, 2007
  11. Nicolas PitreJan 31, 2007
  12. Jeff KingJan 31, 2007
  13. Nicolas PitreJan 31, 2007
  14. Jeff KingJan 31, 2007
  15. Nicolas PitreJan 31, 2007
  16. Jeff KingJan 31, 2007
  17. Junio C HamanoJan 31, 2007
  18. Theodore TsoJan 31, 2007
  19. Junio C HamanoJan 31, 2007
  20. Jakub NarebskiJan 31, 2007
  21. Nicolas PitreJan 31, 2007
  22. Daniel BarkalowJan 31, 2007
  23. Nicolas PitreJan 31, 2007
  24. Daniel BarkalowJan 31, 2007
  25. Nicolas PitreJan 31, 2007
  26. J. Bruce FieldsJan 31, 2007
  27. Jakub NarebskiJan 31, 2007
  28. Nicolas PitreJan 31, 2007
  29. Daniel BarkalowJan 31, 2007
  30. Nicolas PitreJan 31, 2007
  31. Guilhem BonnefilleJan 31, 2007
  32. Carl WorthJan 31, 2007
  33. Johannes SchindelinJan 31, 2007
  34. Santi BéjarJan 31, 2007
  35. Carl WorthJan 31, 2007
  36. Josef WeidendorferFeb 1, 2007
  37. Santi BéjarFeb 1, 2007
  38. Jakub NarebskiFeb 1, 2007
  39. Carl WorthFeb 6, 2007
  40. Junio C HamanoFeb 6, 2007
  41. Junio C HamanoFeb 6, 2007
  42. Jeff KingFeb 6, 2007
  43. Carl WorthFeb 6, 2007
  44. Junio C HamanoFeb 6, 2007
  45. Carl WorthFeb 6, 2007
  46. Jakub NarebskiFeb 6, 2007
  47. Jeff KingFeb 6, 2007
  48. Junio C HamanoFeb 6, 2007
  49. Jeff KingFeb 6, 2007
  50. Nicolas PitreFeb 6, 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.