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

Re: Bug: being stuck in rebase mode when accidently typing `git am`

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Apr 11, 2025, 18:23 UTC
Message-ID
<CALnO6CCbzqez9-BvbuV3NRRMvFLHSv57Tfwj3ibadUAMKznWrw@mail.gmail.com>
In-Reply-To
<76edd34d-3fd1-437e-b8d3-7e64e99644a2@gmail.com>
On Thu, Apr 10, 2025 at 10:35 AM Ludo Pulles <ludo.pulles@gmail.com> wrote:
Show 8 quoted lines
>
> 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)
>
> 1. Run `git init` in an empty directory, and commit once.
> 2. Run `git am` and press Ctrl-C.

Doesn't `git am` print a warning about how it's reading from stdin? Pressing C-d at this point to send EOF just exits "normally."

> 3. Run `git status`. It will say: 'You are currently rebasing. (all
> conflicts fixed: run "git rebase --continue")'.

Yes, this is odd: my shell prompt (using the contrib script) says "AM/REBASE", so I know better: git am --abort does the trick.

This seems like a failure of git-status more than anything; I wonder if there's some difference in how the prompt script checks for in-progress am vs. how git-status does it?

Show 43 quoted lines
> 4. Run `git rebase --continue`
>
> What did you expect to happen? (Expected behavior)
> I expected to go out of the rebase mode such that `git status` would
> say: "nothing to commit, working tree clean"
>
> What happened instead? (Actual behavior)
> It outputs: "warning: could not read '.git/rebase-apply/head-name': File
> does not exist."
> Moreover, you are in rebase mode forever, and you cannot escape from it!
>
> What's different between what you expected and what actually happened?
> Instead of going out of rebase mode (expected), you are still in rebase
> mode and you cannot escape it (actual).
>
> Anything else you want to add:
> `rmdir .git/rebase-apply` fixes the issue
>
> 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.49.0
> cpu: x86_64
> built from commit: 683c54c999c301c2cd6f715c411407c413b1d84e
> sizeof-long: 8
> sizeof-size_t: 8
> shell-path: /bin/sh
> libcurl: 8.12.1
> OpenSSL: OpenSSL 3.4.1 11 Feb 2025
> zlib: 1.3.1
> uname: Linux 6.12.22-1-lts #1 SMP PREEMPT_DYNAMIC Tue, 08 Apr 2025
> 06:20:12 +0000 x86_64
> compiler info: gnuc: 14.2
> libc info: glibc: 2.41
> $SHELL (typically, interactive shell): /bin/bash
>
>
> [Enabled Hooks]
>
>
-- 
D. Ben Knoble
Previous: Ludo PullesNext: D. Ben Knoble
Message 2 of 4 in “Bug: being stuck in rebase mode when accidently typing `git am`”
  1. Ludo PullesApr 10, 2025
  2. D. Ben KnobleApr 11, 2025
  3. D. Ben KnobleApr 11, 2025
  4. Phillip WoodApr 11, 2025

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.