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

ephemeral-branches instead of detached-head?

From
David Jeske <davidj@gmail.com>
Date
Aug 12, 2013, 07:25 UTC
Message-ID
<CA+CP9O6on2NXo6o4_0NoULnT8sgUD3pvvkFZvCTM5xKb38qOeA@mail.gmail.com>

Has there ever been any any discussion of creating an ephemeral-branch name mechanism, instead of using detached HEADs?

By ephemeral, I mean that a branch-name could be created which would live only so long as it is the only named way to reach a ref or the ref is in the working directory. Ephemeral branch names would be local-only and would never be pushed.

For example, if one performed "git checkout 2c29d...", one would not get a detached head-state, but instead would get an ephemeral branch name similar to "etmp/2c29d...". If no changes were checked into this ephemeral branch, it would disappear as soon as it was no longer in the working directory. If any changes were checked in on this branch, it would survive until (a) the ref is given a non-ephemeral branch name, (b) the changes are merged, (c) the ephemeral branch is deleted/discarded.

I'm asking about (and proposing) this mechanism, because it would prevent refs from ever being "accidentally lost", such as occurs in the following scenerios..

1) forgetting to branch a detached head before checkin
2) forgetting a head is detached before moving away from it
3) forgetting about checkins before a submodule update

Also, these "etmp/####" branches would serve as an obvious visible reminder in the branch list that a change was checked in that should either be merged, named, or discarded.

Next: Jonathan Nieder
Message 1 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.