git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug report: I was allowed to "git checkout -b" while mid-rebase
@ 2025-06-19  0:12 Grant Birchmeier
  2025-06-19  0:19 ` Jacob Keller
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Grant Birchmeier @ 2025-06-19  0:12 UTC (permalink / raw)
  To: git


[-- Attachment #1.1: Type: text/plain, Size: 1641 bytes --]

Hello.  I've attached my git-bugreport, but I'll copy/paste the salient
parts here.  Thanks.  Let me know if I can provide anything else.

*What did you do before the bug happened? (Steps to reproduce your issue)*

I was rebasing a branch "ilogger" on my master branch.  While this rebase
was still open, I accidentally ran `git checkout -b net5` (I meant to run
it in a different console)... and it proceeded to switch me to the new
branch even though the the rebase was still in progress.

*What did you expect to happen? (Expected behavior)*

I would expect an error message and a refusal to execute the `git checkout
-b` command.

*What happened instead? (Actual behavior)*

It created a new branch "net5" off of my "ilogger" mid-rebase branch, and
changed me to branch "net5".  I cannot change back to "ilogger" ("error:
you need to resolve your current index first"), and it appears I will need
to finish my rebase on "net5".  Even after I do that, I'm not sure what
state "ilogger" will be in.

*What's different between what you expected and what actually happened?*

I think the proper bahavior is for the "git checkout -b" command to fail
when the current branch is mid-rebase, just like it does when you run `git
checkout` without the `-b`.


-- 
<https://www.connamara.com>

Grant Birchmeier

Director of Engineering, Connamara

gbirchmeier@connamara.com

-- 
This email, along with any attachments, is confidential. If you believe you 
received this message in error, please contact the sender immediately and 
delete all copies of the message. Thank you from Connamara Systems, LLC.

[-- Attachment #1.2: Type: text/html, Size: 3863 bytes --]

[-- Attachment #2: git-bugreport-2025-06-18-1843.txt --]
[-- Type: text/plain, Size: 1822 bytes --]

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

I was rebasing a branch "ilogger" on my master branch.  While this rebase was still open, I accidentally ran `git checkout -b net5` (I meant to run it in a different console)... and it proceeded to switch me to the new branch even though the the rebase was still in progress.

What did you expect to happen? (Expected behavior)

I would expect an error message and a refusal to execute the `git checkout -b` command.

What happened instead? (Actual behavior)

It created a new branch "net5" off of my "ilogger" mid-rebase branch, and changed me to branch "net5".  I cannot change back to "ilogger" ("error: you need to resolve your current index first"), and it appears I will need to finish my rebase on "net5".  Even after I do that, I'm not sure what state "ilogger" will be in.

What's different between what you expected and what actually happened?

I think the proper bahavior is for the "git checkout -b" command to fail when the current branch is mid-rebase, just like it does when you run `git checkout` without the `-b`.

Anything else you want to add:

(nothing)

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.45.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Darwin 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:53:26 PDT 2025; root:xnu-11417.121.6~2/RELEASE_X86_64 x86_64
compiler info: clang: 15.0.0 (clang-1500.3.9.4)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-06-19 17:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19  0:12 bug report: I was allowed to "git checkout -b" while mid-rebase Grant Birchmeier
2025-06-19  0:19 ` Jacob Keller
     [not found] ` <CABURp0orQ-UCzDgJc=STPQZaaEEGwR0GM-GZq_Ty3BXBKYS2iQ@mail.gmail.com>
2025-06-19  2:30   ` Grant Birchmeier
2025-06-19  8:35     ` Re " K Jayatheerth
2025-06-19 17:31 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).