Skip to content

checkout: introduce --detach synonym for "git checkout foo^{commit}"

Jonathan Nieder git 1 version New

Get series with b4
b4 am 20110208102605.GA29660@elie

Versions newest first

  1. v2 Latest3 patches 0 repliesNew

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3checkout: split off a function to peel away branchname argbuiltin/checkout.c+134 -1010 replies
2/3checkout: introduce --detach synonym for "git checkout foo^{commit}"Documentation/git-checkout.txt builtin/checkout.c t/t2020-checkout-detach.sh+126 -70 replies
3/3checkout: rearrange update_refs_for_switch for claritybuiltin/checkout.c+13 -140 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] checkout: introduce --detach synonym for "git checkout foo^{commit}"
Quoted 1 line · Jonathan Nieder

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