Commit Graph
1496 Commits
Author SHA1 Message Date
Stefan HallerandClaude Opus 5.5 2d58a327ec Install updates without asking if update.method is "background"
The option "background" exists, but since the background check never
ran, it never did anything.

If lazygit can update itself, i.e. it was installed from one of our
release archives into a folder that we can write to, install a new
version as soon as a check finds it. The new version takes effect the
next time the user starts lazygit; until then, the note in the
bottom-right corner says so. If installing fails, we try again in an
hour, and the user gets the usual reminders in the meantime.

For all other installs, "background" works like "prompt".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:11:57 +01:00
Stefan HallerandClaude Opus 5.5 61ebf761af fixup! Print a reminder of an available update when lazygit exits
Give the exit message a first line of its own. The menu's first line
now has a link to the release notes, but the exit message goes to the
terminal, and it has a line with the URL of the release notes anyway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:11:57 +01:00
Stefan HallerandClaude Opus 5.5 d9b8fe5587 Print a reminder of an available update when lazygit exits
Users who use lazygit for short sessions, and never leave it idle for a
minute, don't get to see the update menu until a week after the update
came out.

Print a short message to the terminal after lazygit exits, the way gh
and npm do. The user is back in the shell at that point, where they can
run the command that we show. Do this at most once a day, and not on a
day when the user responded to the update menu.

The message doesn't count as a response to the menu. If other lazygit
instances show the menu, it stays open there, and an idle lazygit can
still show it later that day.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:11:57 +01:00
Stefan HallerandClaude Opus 5.5 2396d6e738 amend! Remind the user of an update when lazygit is idle
Remind the user of an update when lazygit is idle

The note in the bottom-right corner is easy to miss. Users need a
notification to actually update, but one that pops up at startup gets in
the way of the work that they started lazygit for.

Show the update menu when the user hasn't pressed a key or used the
mouse for a minute, and no other popup is open. After the user responds
to the menu, don't show it again for a day. Users who never leave
lazygit idle wouldn't see the menu at all, so also show it at startup if
the update has been available for a week and the user never responded to
the menu for it.

The menu now has "Remind me tomorrow" and "Skip this version"; closing
the menu does the same as the former. Skipping a version keeps lazygit
quiet until a newer one comes out, but the note stays.

If several lazygit instances are idle at the same time, e.g. in
different terminal tabs, all of them show the menu. Otherwise a lazygit
that the user forgot in some tab would get the reminder every day, and
the others never. When the user responds to the menu in one of them, the
others close theirs.

If update.method is never, don't show the menu; only the note appears
then. The menu tells the user about this setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:11:57 +01:00
Stefan HallerandClaude Opus 5.5 1f2bc0a4b5 Remind the user of an update when lazygit is idle
The note in the bottom-right corner is easy to miss. Users need a
notification to actually update, but one that pops up at startup gets in
the way of the work that they started lazygit for.

Show the update menu when the user hasn't pressed a key or used the
mouse for a minute, and no other popup is open. After the user responds
to the menu, don't show it again for a day. Users who never leave
lazygit idle wouldn't see the menu at all, so also show it at startup if
the update has been available for a week and the user never responded to
the menu for it.

The menu now has "Remind me tomorrow" and "Skip this version"; closing
the menu does the same as the former. Skipping a version keeps lazygit
quiet until a newer one comes out, but the note stays.

If several lazygit instances are idle at the same time, e.g. in
different terminal tabs, all of them show the menu. Otherwise a lazygit
that the user forgot in some tab would get the reminder every day, and
the others never. When the user responds to the menu in one of them, the
others close theirs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:11:57 +01:00
Stefan HallerandClaude Opus 5.5 92b811be4d Check for updates once a day and show a note when there is one
lazygit currently checks for updates only when the user presses `u` in
the status panel. We want users to learn about a new release within a
day.

Check at startup if the last successful check is at least update.days
ago, and change the default from 14 days to 1. Also check every hour
whether a check is due, so that users who keep lazygit running for
days get the check too. Do all of this on a worker, with a timeout.

When a check finds a newer version, show "Update available" before the
version in the bottom-right corner. Clicking it opens the update menu.
After an update is installed, the note says "Restart to use <version>".

The result of a check goes into state.yml, so a lazygit that starts
later on the same day shows the note without asking GitHub again. For
the same reason, other running instances see the result the next time
they look at the file.

Builds that can't check for updates, and users who set update.method
to never, don't get any of this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:11:57 +01:00
Stefan HallerandClaude Opus 5.5 27923a680a fixup! Rewrite the update check that u in the status panel starts
Tell Homebrew users too that package managers can take a while to get
a new version. We compare with our latest release on GitHub, and
homebrew-core usually gets it a few hours later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:11:57 +01:00
Stefan HallerandClaude Opus 5.5 ce47ad1ae5 fixup! Rewrite the update check that u in the status panel starts
Don't tell the user how to turn off update checks here. Nothing in
this commit checks for updates on its own, and the hint is about
reminders, which a later commit adds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:11:57 +01:00
Stefan HallerandClaude Opus 5.5 b7c0fc7b69 fixup! Rewrite the update check that u in the status panel starts
Show the release notes as a link in the menu's first line instead of
as a menu item. Choosing a menu item closes the menu. If lazygit opened
the menu on its own, users might not know how to get it back after
reading the release notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:11:57 +01:00
Stefan HallerandClaude Opus 5.5 3e87e673a0 fixup! Rewrite the update check that u in the status panel starts
Show why a dev build can't check for updates in a popup instead of a
toast. The user asked for the check, and a toast is easy to miss.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:11:57 +01:00
Stefan HallerandClaude Opus 5.5 89f269af58 Rewrite the update check that u in the status panel starts
Checking for an update with `u` has several problems:

- It offers to download and install the new version for any build
  that has a version, including builds from Homebrew or a Linux
  distribution. Overwriting those makes the package manager report the
  wrong version.
- It only logs its errors, so the user never learns why nothing
  happens. This includes "You already have the latest version". For a
  build from a git checkout, the version is a commit hash; comparing it
  with the release version fails, and the user sees nothing at all.
- Installing always fails on Windows.

Rewrite it on top of the functions from the previous commits. Show the
result of the check in all cases. If there's an update, show a menu
that depends on how lazygit was installed. We only offer "Install now"
for our release archives, and only if we can write to the folder of
the executable. For package managers that we know, we show the command
that updates lazygit. Otherwise we tell the user where to get the new
version. Disable `u` for dev builds and say why.

Installing replaces the executable with a rename, so quitting during
an update can no longer leave a broken binary behind. Instead of
asking for confirmation, wait for the rename to finish before exiting.

Remove the check at startup for now. It never ran, because it checked
for the build source "buildBinary" while .goreleaser.yml sets
"binaryRelease". A later commit adds a new one.

Use os.Executable instead of the osext package; os.Executable didn't
exist yet when this code was written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:11:57 +01:00
Stefan HallerandClaude Opus 5.5 2877762745 Add a String method to VersionNumber
The update check needs to show version numbers in a consistent format,
the same way as the docs links on the status page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:11:57 +01:00
Stefan HallerandClaude Opus 5.5 76064a302b Replace GetAppState and SaveAppState with ReadAppState and UpdateAppState
Each lazygit instance reads state.yml once at startup. Callers change
that copy and then save all of it. So an instance doesn't see what
other instances changed after it started, and when it saves, it
overwrites their changes.

To fix this, the following commits make ReadAppState read the file and
UpdateAppState apply the change to what it finds in the file. For this
to work, callers must express a change as an operation on the current
state: add a command to the front of the history, remove a history
entry by its value, move the current repo to the front of the recent
repos. The call sites already compute the new value from the current
one; move that code into the update function.

This commit still works on the in-memory copy, so it doesn't change
behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 08:10:58 +01:00
Stefan HallerandClaude Opus 5.5 9ff9479baf Exclude the current repo from the recent repos menu by its path
The menu leaves out the first entry of the recent repos list because
that's the repo we're in. This is true as long as each lazygit instance
keeps its own copy of state.yml. The following commits make instances
read the list from the file. The first entry is then the repo that any
instance opened most recently, and that may be a different one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 08:10:58 +01:00
Stefan HallerandClaude Opus 5.5 d2321ca27b Show the short hash and subject of a detached HEAD in the new branch prompt
If you press `n` on the row of a detached HEAD in the branches panel,
the title of the prompt contains the full 40-character commit hash.
Since 5dec080719, the Name of a detached HEAD is the full hash.

Describe the commit in the same way as when you press `n` on it in the
commits panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:34:44 +01:00
Stefan HallerandClaude Opus 5.5 a28738e04b Show a readable name for a detached HEAD in the status panel
If HEAD is detached, the status panel shows the full 40-character
commit hash after the repo name. This also happens during a rebase,
where it used to show the name of the branch being rebased. Since
5dec080719, the Name of a detached HEAD in the model is the full hash.
That commit made the name work as a ref for git commands, but the
status panel still shows it to the user.

During a rebase, show the name of the branch being rebased again. For
any other detached HEAD, show the same text as the top row of the
branches panel, e.g. "(HEAD detached at v1.2)" or "(no branch, bisect
started on master)".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:31:50 +01:00
Stefan HallerandClaude Opus 5.5 73ac8fe6c6 Allow merging into a detached HEAD
Pressing the merge key while HEAD is detached shows an error. This also
happens during a rebase and during a bisect, because HEAD is detached
then. As a result, you can't squash merge another branch at the base of
the current one by starting an interactive rebase with `i`. The
workaround is to squash merge the branch at the tip and move the commit
down. If the merged changes conflict with the branch's own commits, you
have to resolve those conflicts twice this way.

Remove the check. A merge on a detached HEAD is no riskier than a
commit, a cherry-pick or a revert, and lazygit allows all of those
there. It is also useful outside of a rebase, for example to check out
master as a throwaway detached HEAD and merge several branches into it
to see whether they conflict. There is no reason to prevent the user
from doing these things.

If the merge conflicts during a rebase, the merge takes precedence over
the rebase in the working tree state. So continuing goes to the merge
first and then to the rebase.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:59:01 +01:00
Stefan HallerandClaude Opus 5.5 bb924c7ccd Use a readable name for a detached HEAD in the rebase and merge menus
If HEAD is detached, the title of the rebase menu contains the full
40-character commit hash. The name comes from the checked-out branch in
the model, and its Name is a commit hash for a detached HEAD.

Use "HEAD" instead, like git does in the messages of merge commits. If
HEAD is detached because of a rebase, use the name of the branch being
rebased.

The merge menu gets the same name for its tooltips and for the squash
merge message. It can't be opened on a detached HEAD yet; the next
commit changes that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:59:01 +01:00
Stefan Haller 4b03bf6ac8 Remove the "Become a sponsor" link from the status panel's main view 2026-11-13 08:23:58 +01:00
Stefan Haller b915d25ddb Remove the "Donate" and "Ask Question" links from the status bar
If mouse support is on (the default), the right end of the status bar
shows "Donate" and "Ask Question" links in front of the version number.
They take space away from the keybinding options on the left, so fewer
of those fit before they get cut off.

Remove both links and keep only the version number. Also remove the
paragraph of the intro popup that asks users to click the donate
button.
2026-11-13 08:23:34 +01:00
Stefan HallerandClaude Opus 5.5 417dea6381 Let prompts receive pasted text in one piece
Like a menu's filter, a prompt takes a single line of text, so treat
pasted text the same way. Before, the prompt ignored pasted newlines.
This joined the lines without a space. It also ran the keybindings for
other keys in the text, so a pasted Esc closed the prompt, and a pasted
tab switched to the suggestions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:22:50 +01:00
Stefan HallerandClaude Opus 5.5 ebbd2126db Remove hard line breaks from text pasted into the commit description
Do the same as when pasting a commit message with the commit menu, so
that the paragraphs of the body reflow when you edit them. This also
covers a commit message pasted into the summary, since everything after
its first line goes into the description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:22:50 +01:00
Stefan HallerandClaude Opus 5.5 107f0c1352 Don't start the description with an empty line when pasting a message
If you paste text into an empty description, drop the newlines at its
start. This happens when you paste a whole commit message into the
summary with the terminal's paste command. The part after the first
line goes into the description, and it starts with the blank line
between subject and body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:22:50 +01:00
Stefan HallerandClaude Opus 5.5 f2a63e2de0 Handle text pasted into the commit message panel in one piece
Use the new OnPaste handler for the summary and the description. This
replaces the IsPasting checks in the keybindings for confirming and for
switching between summary and description. These checks only worked for
the default keys of those keybindings. If a user had bound Enter or Tab
to something else, pasting a newline or a tab ran that command.

Otherwise the behavior stays the same, except that the panel now drops
Esc and control characters in pasted text. Before, it executed them;
for example, a pasted Esc closed the panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:22:50 +01:00
Stefan HallerandClaude Opus 5.5 b65298c3b1 Remove hard line breaks when pasting a commit message from the clipboard
Do the same as when rewording a commit, so that the paragraphs of the
body reflow when you edit them.

This also matters for the "Copy commit message to clipboard" entry of
the commit menu. It copies the message with the line breaks that
auto-wrapping inserted. Without this change, pasting the copied
message back into the panel would turn these into hard line breaks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:22:50 +01:00
Stefan HallerandClaude Opus 5.5 8b8e3c05aa Check the auto-wrap config inside the helper that removes hard line breaks
All three callers of TryRemoveHardLineBreaks check the
AutoWrapCommitMessage config first and pass the AutoWrapWidth config.
We are about to add a fourth caller, so move both into a CommitsHelper
method. This also makes it impossible to call it with the wrong width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:22:50 +01:00
Stefan HallerandClaude Opus 5.5 b385a4e164 Add "Clear commit message" to the commit menu
Many users don't know that they can clear the commit message panel
quickly by holding down ctrl+u. They hold down backspace instead, and
for a long message this takes a long time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:36:14 +01:00
Stefan HallerandClaude Opus 5.5 5a5e3ac696 Add "Copy commit message to clipboard" to the commit menu
The commit menu (ctrl+o in the commit message panel) can paste a message
from the clipboard, but it can't copy the message to it. Copying is
useful for keeping a message around while committing something else
first. For example, if a pre-commit hook fails, users may want to
commit a fix for it before they come back to the original change. If
they commit the fix through the commit message panel, lazygit deletes
the preserved message of the original change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:36:14 +01:00
Stefan HallerandClaude Opus 5.5 f11e1dca4c Extract a helper that joins summary and description into a message
The next commit needs to build a commit message from the commit panel
in git's canonical format too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:51:44 +01:00
Stefan HallerandClaude Opus 5.5 fc1443dee4 Change the commit menu's key for pasting a commit message to V
We are about to add an entry for copying the commit message to the
clipboard. Its obvious key `c` is already taken by "Add co-author", so
use `C` for copying and `V` for pasting. This matches the keys for
copying and pasting commits in the commits panel.

This means changing the key of an existing entry. We change the one for
pasting and not the one for adding a co-author, because users are
likely to paste a commit message less often than they add a co-author.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:51:44 +01:00
Stefan HallerandClaude Opus 5.5 88cf4dd97d Wait for the files refresh before committing after staging all files
If you commit with shift-C ("Commit changes using git editor") while no
files are staged, lazygit asks whether to stage all files. Confirming
this often fails with "fatal: Unable to create '.../.git/index.lock':
File exists".

After staging the files, we refresh the files view and then retry the
commit right away. The refresh runs `git status` on a worker. Since it
is a foreground refresh, git takes index.lock to write its refreshed
stat cache back to the index. So `git commit` can start while the status
command still holds the lock. Committing with `c` doesn't run into this
in practice, because the refresh is done long before the user has typed
a commit message.

Retry the commit in the refresh's Then instead. We already do this when
gui.skipNoStagedFilesWarning is on.

Without the fix, the new test failed in two of six runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 13:15:34 +01:00
Stefan HallerandClaude Opus 5.5 668f4032da Extract a helper that stages all files and then runs a handler
Prepares for using it when the user confirms the "No files staged"
prompt too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 13:13:25 +01:00
Stefan HallerandClaude Opus 5.5 8683f60761 End a squash merge when the user discards all of its changes
Discarding a file or directory in the files panel runs git commands on
these paths only, and these leave SQUASH_MSG alone. If users discard
all changes of a squash merge this way, lazygit keeps showing a merge
in progress, and the next commit gets the squash merge message.

Abort the squash merge after "Discard all changes" if no changes are
left. Untracked files don't count, because a squash merge stages the
files that it adds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:36:41 +01:00
Stefan HallerandClaude Opus 5.5 09780de32e Use the squash merge message when committing a squash merge
After "Squash merge and leave uncommitted", the commit panel opens
empty, or with the commit prefix of the branch. Users have to type a
message for the squash merge themselves. "git commit" from the terminal
suggests the message in SQUASH_MSG instead.

Show the message in SQUASH_MSG in the commit panel, unless there is a
preserved message. It takes precedence over the commit prefix, like the
message of "Squash merge and commit" does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:36:41 +01:00
Stefan HallerandClaude Opus 5.5 c7c514fa44 Let the user continue or abort a squash merge
If a squash merge stops with conflicts, lazygit doesn't show a merge in
progress, because "git merge --squash" doesn't write MERGE_HEAD. After
resolving the conflicts, users have to commit the changes themselves,
and type the message that "Squash merge and commit" would have used. To
give up, they have to discard the changes. The "Abort the merge" item
of the conflicts menu fails with "You are currently neither rebasing
nor merging".

"git merge --squash" writes SQUASH_MSG, a message for committing the
changes. Git removes it when the changes are committed, reset or
stashed, and when switching branches. Show a merge in progress while
the file exists. Continue it with "git commit", and abort it with "git
reset --merge", like "git merge --abort" does.

Write the configured squashMergeMessage into SQUASH_MSG, so that
continuing uses it. Do this for "Squash merge and leave uncommitted"
too, so that both variants make the same commit. A merge in progress is
now shown after this variant until the user commits the changes. We
don't offer to continue it when its conflicts are resolved, though,
because the user asked us not to commit.

Select the new commit after "Squash merge and commit", like after other
merges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:36:41 +01:00
Stefan HallerandClaude Opus 5.5 9942101b3e Identify the operation to continue or abort by its working tree state
GenericMergeOrRebaseAction takes the name of the git command whose
--continue, --skip or --abort option it runs. We are about to show a
squash merge as an operation in progress, and it has no such command.
"git merge --continue" and "git merge --abort" refuse to run without
MERGE_HEAD, and a squash merge doesn't write it. Pass the working tree
state instead, so that GenericMergeOrRebaseAction can decide which
commands to run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:36:41 +01:00
Stefan HallerandClaude Opus 5.5 c7002e5e52 Discard edits on top of staged changes when aborting a merge or cherry-pick
If a merge, cherry-pick, revert or "git am" stops with conflicts, users
often edit the files that git changed, for example to fix the build. If
they then decide to give up and abort, git fails with "Entry 'file' not
uptodate. Cannot merge." It keeps unstaged changes when aborting, but it
can't reset the staged changes of a file underneath them. "git am
--abort" even stops halfway, after it has reset the conflicted files.

Git refuses to start any of these operations if there are staged
changes, or if a file that it has to change has unstaged changes. So
unstaged changes on top of staged ones were made after git stopped.
Discard them before aborting, but ask the user first, listing the
files. A rebase doesn't need this, because "git rebase --abort"
discards all changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:36:41 +01:00
Stefan HallerandClaude Opus 5.5 acb54f73d1 Disable squash merging while there are staged changes
Git refuses to merge a branch while there are staged changes, unless
the merge is a fast-forward. A fast-forward keeps the staged changes as
they are. A squash merge that git can fast-forward adds the changes of
the branch to them, though, and "Squash merge and commit" then commits
them all.

Disable both squash merge items in the merge menu while there are
staged changes, so that squash merges behave like other merges. We will
rely on this when we let the user abort a squash merge. Aborting resets
the staged changes, so they must all come from the merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:36:41 +01:00
Stefan HallerandClaude Opus 5.5 df21b8cca0 Show the patches that "git am" hasn't applied yet
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>
2026-11-08 15:17:17 +01:00
Stefan HallerandClaude Opus 5.5 20c6ae4c86 Return the reason why todos can't be edited from a single function
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>
2026-11-08 15:17:17 +01:00
Stefan HallerandClaude Opus 5.5 7adcfff244 Show a "git am" in progress, and let the user continue, skip or abort it
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>
2026-11-08 15:17:17 +01:00
Stefan HallerandClaude Opus 5.5 6a0ef0b750 Describe the operation in progress with a translated phrase
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>
2026-11-08 15:17:17 +01:00
Stefan HallerandClaude Opus 5.5 633bedf4fd Pass only the branch name to BranchesBelow
The commits panel will need to call it. All it knows is the name of the
checked-out branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:43:36 +01:00
Stefan HallerandClaude Opus 5.5 4ba8f7c175 Move BranchesBelowInStack to a new branchstack package
The commits list will need it to mark the branches of a stack, and so
will the "go to bottom" command of the commits panel to find their
beginnings. Neither the presentation nor the context package can import
helpers.

Rename it to BranchesBelow, since the name of the package says that it
is about stacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:36:41 +01:00
Stefan HallerandClaude Opus 5.5 fabc14d7e5 Keep the conflicts popup open after moving a patch into a new commit
If moving a custom patch into a new commit stops at a conflict,
CheckMergeOrRebase shows the "Conflicts!" popup. The handler then
focused the commits view anyway, and this closed the popup.

Only focus the commits view if the operation finished.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 19:25:48 +01:00
Stefan HallerandClaude Opus 5.5 3864ddc52c Unify the handlers for moving a patch into a new commit
The handlers for moving the patch into a new commit before or after the
original one differ only in the git command they call. The next commit
fixes a bug that both have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 19:25:48 +01:00
Stefan HallerandClaude Opus 5.5 e8261e06d1 Disable moving a patch between a merge commit and another commit
If the patch comes from a merge commit, moving it to a later commit
leaves the user in a rebase that is stuck before its first todo.
Moving it to an earlier commit, or into a new commit before the merge,
finishes, but with surprising results. The rebase doesn't replay a
merge commit; it recreates it from its parents. If the patch contains
changes from the merged branch, the commits on that branch that made
them become empty. And a new commit "before" the merge ends up at the
tip of the merged branch.

Moving a patch to a later merge commit gets stuck in the same way.
Moving a patch to a merge commit isn't useful in either direction, so
disable both.

The other patch commands amend the merge commit itself and work fine,
so they stay enabled. They are useful for removing changes that were
added to a merge commit by accident.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 19:25:48 +01:00
Stefan HallerandClaude Opus 5.5 fb1b6ed1c1 Don't offer to push or pull branches merged into a local main branch
When pushing master, lazygit offers to push other branches along with
it if they were merged into master locally and have unpushed commits.
Pulling master offers to update such branches in the same way. These
branches aren't part of a stack, so the menu only adds an extra step to
an ordinary push or pull.

This happens because a branch counts as stacked below the current one
if its tip is one of the current branch's commits that aren't merged
into a main branch yet. A commit's merged status only looks at the
remote branch of each main branch. So until master is pushed, the
commits that were merged into it locally count as unmerged. The same
goes for pushing or pulling a feature branch on top of such a master.

Treat the commits that a local main branch contains as merged too, so
that the search for stacked branches stops at a main branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 15:12:36 +01:00
Stefan HallerandClaude Opus 5.5 0b87c9e610 Ask git which commits a bisect hasn't ruled out yet
The commits view marks the commits that a bisect hasn't ruled out yet
with a "?". To find them, it looks for the bad commit and the first good
commit in the list, and marks the commits between them. If there's no
good commit in the list, it marks none. This is the case while git
tests the merge base of a good and a bad commit on different branches.
It's also the case early in a long bisect, when the good commit is
further down than the commits that we load. With merges, the commits
between the two can also include some that the bisect has ruled out.

Ask git instead, with "git rev-list <bad> --not <good>...", when
refreshing the commits while git knows both a good and a bad commit.
This takes about as long as the git log that loads the commits, or
less, and it gets faster as the bisect goes on. Keep only the commits
that the commits view has loaded, because git may list many more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 12:17:43 +01:00
Stefan HallerandClaude Opus 5.5 368633f69c Show the result of a finished bisect instead of the bisect menu
Once git has nothing left to test, the bisect menu offers marking or
skipping the current commit, although the user has marked it already. If
git found the first bad commit without checking out anything to test,
the menu acts on the selected commit instead, as if git didn't know both
a good and a bad commit yet. At this point, the user wants to see the
result and reset the bisect.

Show the "Bisect complete" dialog again instead of the menu. It names
the first bad commit and asks whether to reset the bisect. This also
lets the user see the result again after declining the reset when the
bisect finished.

If git stopped without finding the first bad commit, because the merge
base of the good and the bad commit is bad, show the confirmation for
resetting the bisect. Git said why it stopped when it did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 11:27:58 +01:00