Skip to content

When a "git am" in progress, let the user continue, skip or abort it - #6196

Merged
stefanhaller merged 4 commits into
masterfrom
support-git-am
Nov 8, 2026
Merged

stefanhaller merged 4 commits into
masterfrom
support-git-am

Conversation

@stefanhaller

Copy link
Copy Markdown
Collaborator

Users can copy commits from one repo to another with "git format-patch" and "git am", for example with custom commands. If "git am" stopped with a conflict, lazygit showed this as a rebase, because git am uses the rebase-apply directory too. The rebase options in the m menu didn't work either; git refuses to run "git rebase --continue" during an am.

Recognize an am by the rebase-apply/applying file, and call this state "applying patches". The m menu then offers "git am --continue", "--abort" and "--skip".

stefanhaller and others added 4 commits November 8, 2026 15:17
The texts for aborting or continuing a merge, rebase, cherry-pick or
revert insert the git command name into the sentence, as in "Abort the
rebase". We are going to support "git am" next, and "Abort the am"
makes no sense.

Give each operation a translated phrase like "the rebase" instead, and
use it as a placeholder in these texts. Rename the texts too. The
existing translations still use %s, and this way lazygit ignores them
until they are updated.

This changes the wording of the abort confirmation slightly, from
"Abort rebase" to "Abort the rebase", and from "abort the current
rebase" to "abort the rebase".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Users can copy commits from one repo to another with "git format-patch"
and "git am", for example with custom commands. If "git am" stopped
with a conflict, lazygit showed this as a rebase, because git am uses
the rebase-apply directory too. The rebase options in the m menu didn't
work either; git refuses to run "git rebase --continue" during an am.

Recognize an am by the rebase-apply/applying file, and call this state
"applying patches". The m menu then offers "git am --continue",
"--abort" and "--skip".

If "git am --continue" finds nothing to commit, it says "No changes -
did you forget to use 'git add'?". Unlike for a rebase, don't skip the
patch in that case. Without --3way, git am leaves the files alone if a
patch doesn't apply, and skipping would lose the patch.

If a lock error stops "git am --continue" or "--skip" after it has moved
on to the next patch, don't run it again; this could skip that patch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All callers turned the result of isCherryPickingOrReverting into the
same disabled reason. The next commit adds a second reason for "git
am", so return the reason itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Show them in the commits panel under a "Pending patches" header, like
the todos of a rebase or cherry-pick. The patches usually come from
another repository, so we can't look up their commits. Instead, take
the subject, author and date from the patch files in .git/rebase-apply,
and show the patch itself in the main view.

Git has no way of editing these todos, so disable the actions that
would edit them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stefanhaller stefanhaller added the enhancement New feature or request label Nov 8, 2026
@stefanhaller
stefanhaller merged commit f2b182d into master Nov 8, 2026
13 checks passed
@stefanhaller
stefanhaller deleted the support-git-am branch November 8, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant