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

Re: ephemeral-branches instead of detached-head?

From
David Jeske <davidj@gmail.com>
Date
Aug 12, 2013, 12:14 UTC
Message-ID
<CA+CP9O7--HXQdZXH9MJEh0VqdwpYqb052KYrvZqYhbfajpPG0A@mail.gmail.com>
In-Reply-To
<CA+CP9O5fhyQrn3SboafocWJjaAywJHC0T-bw+AXk_8RX53hJ6Q@mail.gmail.com>

@Junio - to put the issue in the context of your previous comments on the topic... way back when you made a comment about warnings during commits to detached heads..

http://git.661346.n2.nabble.com/RFC-Detached-HEAD-reminder-on-commit-td834710.html#a834959
> If we _really_ don't want newbies to shoot themselves in the foot, we
> probably can issue a loud warning when they detach there HEAD.
> Oh, wait,... we already do that.

The reason this rationale doesn't ring true for me, is that it is *very* common for me to checkout a detached-head and there is nothing odd or dangerous about it. I do this when using checkout to move around the history to inspect, build, and test different revisions. As a result, it's very easy to just start ignoring this (usually meaningless) message.

The dangerous situation only occurs when something is committed onto a detached-head, and at this point there is no warning. The "# Not currently on any branch" message that appears during "git status" easily blends in with boilerplate text there.

IMO, the current warning during checkout of a detached-head is misplaced. It should be removed, and instead there should only be a warning after detached-head commit, since this is the only time there is a danger of losing something.

With my proposed "ephemeral branch" concept, there is no warning necessary in either case, since any check-ins left dangling would get names in the branch space you could see and take a look at. If that dangling head was temporary and was named or rebased, the ephemeral branch name would disappear automatically, leaving the expert-user with no warnings and no annoyance, while the novice user with a simple tool to help them not lose track of changes they made.

Previous: David JeskeNext: Duy Nguyen
Message 5 of 24 in “ephemeral-branches instead of detached-head?”
  1. David JeskeAug 12, 2013
  2. Jonathan NiederAug 12, 2013
  3. Junio C HamanoAug 12, 2013
  4. David JeskeAug 12, 2013
  5. David JeskeAug 12, 2013
  6. Duy NguyenAug 12, 2013
  7. Andreas SchwabAug 12, 2013
  8. Junio C HamanoAug 12, 2013
  9. David JeskeAug 12, 2013
  10. David JeskeAug 12, 2013
  11. Junio C HamanoAug 12, 2013
  12. Duy NguyenAug 13, 2013
  13. Junio C HamanoAug 13, 2013
  14. Sitaram ChamartyAug 14, 2013
  15. Junio C HamanoAug 14, 2013
  16. Sitaram ChamartyAug 14, 2013
  17. Jeff KingAug 14, 2013
  18. Andres PereraAug 14, 2013
  19. Sitaram ChamartyAug 14, 2013
  20. Andres PereraAug 14, 2013
  21. Duy NguyenAug 13, 2013
  22. Fwd: ephemeral-branches instead of detached-head?David Jeske, Aug 13, 2013
  23. Junio C HamanoAug 13, 2013
  24. Junio C HamanoAug 13, 2013

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.