mbox series

[0/2] checkout: introduce "--to-branch" option

Message ID pull.1095.git.1639117329.gitgitgadget@gmail.com (mailing list archive)
Headers show
Series checkout: introduce "--to-branch" option | expand

Message

Linus Arver via GitGitGadget Dec. 10, 2021, 6:22 a.m. UTC
Sometimes people expect to checkout to a commit (or a commit which tag
reference to) and develop on its corresponding branch. This may take some
steps:

$ git checkout v1.1
$ git log  # search for the branch dev1
$ git checkout dev1


collapse the above steps into one step:

$ git checkout --to-branch v1.1
Switched to branch 'refs/heads/dev1'


This will help users switch to the unqiue branch quickly.

Thanks.

ZheNing Hu (2):
  checkout: handling branch_info memory leak
  checkout: introduce "--to-branch" option

 Documentation/git-checkout.txt |  8 +++-
 builtin/checkout.c             | 49 +++++++++++++++++++-
 t/t2018-checkout-branch.sh     | 85 ++++++++++++++++++++++++++++++++++
 t/t9902-completion.sh          |  1 +
 4 files changed, 140 insertions(+), 3 deletions(-)


base-commit: abe6bb3905392d5eb6b01fa6e54d7e784e0522aa
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1095%2Fadlternative%2Fcheckout-w-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1095/adlternative/checkout-w-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1095