From: LeSeulArtichaut <leseulartichaut@gmail.com>
To: git@vger.kernel.org
Subject: [Bug report] Git gets stuck in rebase mode
Date: Wed, 30 Dec 2020 22:41:44 +0100 [thread overview]
Message-ID: <ECF77241-0631-45D6-8B79-4250EE777A5D@gmail.com> (raw)
What did you do before the bug happened? (Steps to reproduce your issue)
I tried to rebase a branch, say `master`, onto a commit that does not exist in my local repository, say `37b52f3b750b11b9ef60db118f737a66af3bf242`:
`git rebase master 37b52f3b750b11b9ef60db118f737a66af3bf242`
- The branch has to be valid (e.g. `git rebase foo 37b52f3b750b11b9ef60db118f737a66af3bf242` doesn’t reproduce the bug)
- The commit SHA has to be a full SHA (e.g. `git rebase master 37b52f3b750b11b9ef60db118f737a66af3bf2 #42` doesn’t reproduce the bug)
Repro "from scratch":
```zsh
mkdir git-bug
cd git-bug
git init
touch foo.txt
git add foo.txt
git commit -m 'Initial commit'
git rebase master 37b52f3b750b11b9ef60db118f737a66af3bf242
```
What did you expect to happen? (Expected behavior)
Git either successfully applies the rebase or gives an error.
What happened instead? (Actual behavior)
```
error: Could not read 37b52f3b750b11b9ef60db118f737a66af3bf242
fatal: Invalid symmetric difference expression b91ebd8a08983ed5c27a3946821be02a39f99b3c…37b52f3b750b11b9ef60db118f737a66af3bf242
```
Git then instead gets « stuck » in rebase mode (i.e. a `.git/rebase-merge` directory exists), with the following visible effects:
- `git status` kind of gets confused:
```bash
$ git status
On branch master
git-rebase-todo is missing.
No commands done.
No commands remaining.
You are currently editing a commit during a rebase.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
nothing to commit, working tree clean
```
- powerlevel10k displays a `rebase-i` state
- `git rebase --continue` and `git rebase --abort` fail:
```bash
$ git rebase --continue
error: could not open '.git/rebase-merge/git-rebase-todo': No such file or directory
$ git rebase --abort
fatal: unable to read tree 37b52f3b750b11b9ef60db118f737a66af3bf242
```
This disappears by deleting the `.git/rebase-merge` directory.
What's different between what you expected and what actually happened?
I didn’t expect Git to stay stuck in rebase. After the failure in the `rebase` command, the `.git/rebase-merge` directory should be deleted.
[System Info]
git version:
git version 2.30.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Nov 10 00:10:30 PST 2020; root:xnu-6153.141.10~1/RELEASE_X86_64 x86_64
compiler info: clang: 12.0.0 (clang-1200.0.32.28)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh
[Enabled Hooks]
next reply other threads:[~2020-12-30 21:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-30 21:41 LeSeulArtichaut [this message]
2020-12-31 23:55 ` [PATCH] rebase: verify commit parameter René Scharfe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ECF77241-0631-45D6-8B79-4250EE777A5D@gmail.com \
--to=leseulartichaut@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).