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

[PATCH v2 0/3] checkout: introduce --detach synonym for "git checkout foo^{commit}"

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Feb 8, 2011, 10:26 UTC
Message-ID
<20110208102605.GA29660@elie>
In-Reply-To
<20110208005238.GB24340@elie>
Jonathan Nieder wrote:
> Two of the new tests fail. :)

... and here's a reroll fixing them. Applies on top of the old uk/checkout-ambiguous-ref (0cb6ad3, 2011-01-11).

Patch 1 is an irrelevant cleanup, for while I have your eyes on this code. :)

Patch 2 introduces the --detach option, taking care to error out in special cases.

Patch 3 is another cleanup, to make the effect of patch 2 more clear.
Thanks again for your help.
Jonathan Nieder (2):
  checkout: split off a function to peel away branchname arg
  checkout: rearrange update_refs_for_switch for clarity
Junio C Hamano (1):
  checkout: introduce --detach synonym for "git checkout foo^{commit}"
 Documentation/git-checkout.txt |   13 ++-
 builtin/checkout.c             |  265 +++++++++++++++++++++++----------------
 t/t2020-checkout-detach.sh     |   95 ++++++++++++++
 3 files changed, 262 insertions(+), 111 deletions(-)
 create mode 100755 t/t2020-checkout-detach.sh
Previous: Jonathan NiederNext: Jonathan Nieder
Message 13 of 18 in “[1.8.0] git checkout refs/heads/foo checks out branch foo”
  1. Martin von ZweigbergkFeb 7, 2011
  2. Junio C HamanoFeb 7, 2011
  3. Jeff KingFeb 7, 2011
  4. Sverre RabbelierFeb 7, 2011
  5. Jonathan NiederFeb 7, 2011
  6. Junio C HamanoFeb 7, 2011
  7. Jeff KingFeb 7, 2011
  8. Jonathan NiederFeb 8, 2011
  9. Jeff KingFeb 8, 2011
  10. Martin von ZweigbergkFeb 8, 2011
  11. checkout: introduce --detach synonym for "git checkout foo^{commit}"Jonathan Nieder, Feb 8, 2011
  12. Jonathan NiederFeb 8, 2011
  13. 0/3 checkout: introduce --detach synonym for "git checkout foo^{commit}"Jonathan Nieder, Feb 8, 2011
  14. 1/3 checkout: split off a function to peel away branchname argJonathan Nieder, Feb 8, 2011
  15. 2/3 checkout: introduce --detach synonym for "git checkout foo^{commit}"Jonathan Nieder, Feb 8, 2011
  16. 3/3 checkout: rearrange update_refs_for_switch for clarityJonathan Nieder, Feb 8, 2011
  17. Heiko VoigtFeb 7, 2011
  18. Martin von ZweigbergkFeb 8, 2011

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.