Commit graph

6889 commits

Author SHA1 Message Date
Stefan Haller ef92e30315 Bump gocui
The main change here is https://github.com/jesseduffield/gocui/pull/85, which
avoids breaking lines after footnote symbols in commit messages (e.g. [1]).

[1]: https://www.example.com/this-is-a-really-long-url-that-lazy-git-automatically-wraps-and-is-an-issue
2025-10-02 17:28:13 +02:00
Stefan Haller cb2b5c3738
Hide the cursor when the password prompt is showing (#4878)
The cursor is a bit of a security concern, because it reveals the length
(and typing pattern) of the password.

Resolves #4877.
2025-09-20 11:14:05 +02:00
Stefan Haller 851afe94f5 Hide the cursor when the password prompt is showing
The cursor is a bit of a security concern, because it reveals the length (and
typing pattern) of the password.
2025-09-20 11:11:46 +02:00
Stefan Haller 6941b81992
Don't log the git rev-list command that we use for IsBranchMerged (#4896)
When you delete a branch, we call this function to determine whether we
need to ask for confirmation of not. We don't want to log this, because
it's not a command that a user would normally use as part of this
operation.
2025-09-20 11:11:00 +02:00
Stefan Haller 2b152dcf5e Don't log the git rev-list command that we use for IsBranchMerged
When you delete a branch, we call this function to determine whether we need to
ask for confirmation of not. We don't want to log this, because it's not a
command that a user would normally use as part of this operation.
2025-09-20 11:07:43 +02:00
Stefan Haller bbef570225
Make running with --debug and running integration tests work when built with go 1.25 (#4910)
The go-deadlock package needed to be updated to be compatible with go
1.25.
2025-09-20 11:07:18 +02:00
Stefan Haller f689b32c33 Bump the go-deadlock dependency to v0.3.6
This is needed for compatibility with go 1.25.
2025-09-20 10:51:37 +02:00
Stefan Haller d56a9cf73e
Fix MoveCommitsToNewBranch description typo (#4867) 2025-09-18 12:29:23 +02:00
Torben Koch 308a4d5c93 fix command description typo 2025-09-18 12:24:25 +02:00
Stefan Haller 3de12b7fde
Fix staging when using the new useExternalDiffGitConfig config (#4895)
This new config was introduced in 0.55, but it made it impossible to
enter the staging view or custom patch building view.

Fixes
https://github.com/jesseduffield/lazygit/pull/4832#issuecomment-3289371491.
2025-09-17 20:39:08 +02:00
Stefan Haller c35e3776dd Fix staging when using the new useExternalDiffGitConfig config
This new config was introduced in 0.55, but it didn't work in the staging view
or custom patch building view.
2025-09-17 20:37:14 +02:00
Stefan Haller b4a38a368a
Don't hide keybindings that match the confirmMenu key in the keybindings menu (#4880)
In all other menus besides the keybindings menu it makes sense to hide
keybindings that match the confirmMenu binding. This is important to
make it clear which action will be triggered when you press the key.

In the keybindings menu this is different; the main purpose of that menu
is not to allow triggering commands by their key while the menu is open,
but to serve as a reference for what the keybindings are when it is not
open. Because of this, it is more important to show all bindings in this
menu, even if they conflict with the confirmMenu key.

This fixes a regression introduced in b3a3410a1a.

Fixes #4879.
2025-09-15 17:02:50 +02:00
Stefan Haller 26096d9dd9 Don't hide keybindings that match the confirmMenu key in the keybindings menu
In all other menus besides the keybindings menu it makes sense to hide
keybindings that match the confirmMenu binding. This is important to make it
clear which action will be triggered when you press the key.

In the keybindings menu this is different; the main purpose of that menu is not
to allow triggering commands by their key while the menu is open, but to serve
as a reference for what the keybindings are when it is not open. Because of
this, it is more important to show all bindings in this menu, even if they
conflict with the confirmMenu key.

This fixes a regression introduced in b3a3410a1a.
2025-09-07 12:43:54 +02:00
Jesse Duffield 0d5a410114
Update README.md 2025-09-06 17:11:27 +10:00
Jesse Duffield 0553c00f61
Update README.md 2025-09-06 16:56:50 +10:00
Jesse Duffield d65f638869
Update README.md 2025-09-06 16:51:31 +10:00
Jesse Duffield 2602426d43
README.md: Update Sponsors (#4795)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-09-06 09:42:07 +10:00
github-actions[bot] a0af7403cc README.md: Update Sponsors 2025-09-05 17:00:11 +00:00
Stefan Haller 900d8be359
Add dev container feature as installation method to README (#4876)
### PR Description

Implements #4874
2025-09-05 18:59:58 +02:00
Henning Lorenzen 4c686fc66e
Update README.md 2025-09-05 18:47:51 +02:00
Stefan Haller 2469420efd
Update translations from Crowdin (#4873) 2025-09-05 10:50:09 +02:00
Stefan Haller d52ff052bb Update translations from crowdin 2025-09-05 10:47:51 +02:00
Stefan Haller c0805f117e
Make it possible to rebind the Confirm keybinding (#4860)
### PR Description

Remapping `keybinding.universal.confirm` from `<enter>` to something
like `y` is currently impossible because the same keybinding is also
used to confirm prompts (e.g. "New branch") and the search prompt. Fix
this by hard-coding enter for those; it doesn't really make sense to use
any other key for prompts.

While at it, add separate bindings for `confirmMenu` and
`confirmSuggestion` for those who would like to have different keys for
these. Of these, `confirmMenu` could be a little tricky because menus
are sometimes used purely as a choice (e.g. in "Amend commit attribute"
or the global keybindings menu), in which case you might want to use
`<enter>`, but other times as a substitute for a confirmation (e.g. for
"Delete branch"), in which case you might want to remap to `y`. I don't
have a great idea what to do about that, to be honest. Feedback welcome.

In this PR we only take care of Confirm, which many people seem to be
concerned about. We might consider doing something similar for Esc, but
it seems less urgent, and I'm out of time now. 😄

This seemingly simple change required some serious refactoring under the
hood, so thorough testing would be good to ensure we didn't break
anything.

Closes #2611
Closes #2767
Closes #3471

Related: #2768
2025-09-05 10:46:33 +02:00
Stefan Haller b3a3410a1a Remove keybindings for menu items that are the same as the menu confirm key
This is needed when remapping the confirmMenu key to, say, "y", and there's a
menu that has an item with a "y" binding. This already worked correctly (confirm
takes precedence, as desired), but it's still confusing to see the item binding.
2025-09-05 10:42:04 +02:00
Stefan Haller b413710d8c Add separate keybindings for confirmMenu and confirmSuggestion
It seems useful to have the flexibility to remap "enter" in confirmations to
"y", but keep "enter" for menus and suggestions (even though we sometimes use
menus as confirmations, but it's still good to give users the choice).
2025-09-05 10:42:04 +02:00
Stefan Haller 81868de264 Hard-code "enter" for adding lines in integration tests
This one doesn't make a difference in practice because we don't remap the key in
tests, but if we would, then this would no longer work correctly. It's just more
correct this way.
2025-09-05 10:42:04 +02:00
Stefan Haller ea7050437d Fix <enter> keybinding for switching to a worktree
The universal.confirm keybinding is the wrong one to use for this, we want
universal.goInto instead. They are both bound to "enter" by default, but when
remapping confirm to "y" we don't want to use that for entering worktrees.
2025-09-05 10:42:04 +02:00
Stefan Haller 6303c64232 Hard-code "enter" for search prompt
Like with the previous commit, it doesn't make sense to use any other key than
enter for the search prompt.
2025-09-05 10:42:04 +02:00
Stefan Haller b006c83181 Hard-code "enter" for editable prompts
Rebinding the universal.confirm keybinding currently doesn't make sense, because
the rebound key would also be used for editable prompts, which means you would
only be able to bind it to a ctrl key (not "y", which is desirable for some
people), and also it would allow you to enter a line feed in a branch name.

Fix this by always using enter for editable prompts.
2025-09-05 10:42:04 +02:00
Stefan Haller 0a64e1abb3 Update cheatsheets for the previous commit
Done in a separate commit because the diff is already so long.
2025-09-05 10:42:03 +02:00
Stefan Haller 5a630aeda1 Refactor: add a separate Prompt view
So far, confirmations and prompts were handled by the same view, context, and
controller, with a bunch of conditional code based on whether the view is
editable. This was more or less ok so far, since it does save a little bit of
code duplication; however, now we need separate views, because we don't have
dynamic keybindings, but we want to map "confirm" to different keys in
confirmations (the "universal.confirm" user config) and prompts (hard-coded to
enter, because it doesn't make sense to customize it there).

It also allows us to get rid of the conditional code, which is a nice benefit;
and the code duplication is actually not *that* bad.
2025-09-05 10:42:03 +02:00
Stefan Haller 94aa1101c9
Fix rare crash in interactive rebase (merge command without comment) (#4872)
This fixes a crash in an interactive rebase when there's a merge command
in the rebase-todo file that doesn't have a comment. I don't know under
what circumstances this can happen; git itself doesn't produce these,
but it is theoretically possible for the user to do this manually by
doing `git rebase --edit-todo`, or third-party tools could do it too.

We had one user report a crash because of this, so it seems worth fixing
it.

Closes #4858.
2025-09-05 10:41:23 +02:00
Stefan Haller ffccfd6e42 Bump git-todo-parser
This fixes a crash in an interactive rebase when there's a merge command in the
rebase-todo file that doesn't have a comment. I don't know under what
circumstances this can happen; git itself doesn't produce these, but it is
theoretically possible for the user to do this manually by doing `git rebase
--edit-todo`, or third-party tools could do it too.

We had one user report a crash because of this, so it seems worth fixing it.
2025-09-05 10:37:20 +02:00
Stefan Haller 2bf2c38e9b
docs(VISION): fix "Dicoverability" typo (#4866) 2025-09-03 09:29:49 +02:00
Ricardo Fernández Serrata 83f95bf8fe
docs(VISION): fix "Dicoverability" typo 2025-09-03 00:52:38 -04:00
Stefan Haller be0d7a6e73
Log the hash of dropped stashes (#4850)
### PR Description

If you dropped/popped a stash accidentally, the logged hash can help
recover it more easily.

Supersedes #4847.
2025-08-26 14:02:43 +02:00
Stefan Haller 438f5c0eda Log hashes when dropping/popping stashes
If you dropped/popped a stash accidentally, the logged hash can help recover it
more easily.
2025-08-25 19:23:30 +02:00
Stefan Haller 5cb80b8635 Fix command log for stash commands
With the exception of Rename Stash, they would all just log "Stash".
2025-08-25 19:23:30 +02:00
Stefan Haller ee81a8e3c2 Add hash field to models.StashEntry 2025-08-25 19:23:30 +02:00
Stefan Haller 61d5b1646d Cleanup: bring stash loader test up to date
It didn't actually test how it parses the unix time stamps, and the test only
succeeded because the code is lenient against it missing.
2025-08-25 19:23:30 +02:00
Stefan Haller 5a6de1248f
Fix dropping range selection of filtered stashes (#4849)
### PR Description

When filtering by file path, dropping a range selection of stashes would
drop the wrong ones if those stashes would be noncontiguous in the
unfiltered list.
2025-08-25 19:21:38 +02:00
Stefan Haller bf419abb8e Fix dropping a range of stashes in filtered mode
To fix the problem described in the previous commit, iterate backwards over the
stashes that we want to delete. This allows us to use their Index field.
2025-08-25 18:41:06 +02:00
Stefan Haller ef3e899f5b Add test demonstrating problem with dropping stashes in filtering mode
As can be seen from the test, it deletes the wrong stashes in this case, because
it assumes the selection is contiguous.
2025-08-25 15:56:39 +02:00
Stefan Haller a0f4614fdc Cleanup: remove unnecessary ToggleRangeSelect
The next RangeSelectDown actually cancels the sticky range select and turns it
into a non-sticky one.
2025-08-25 14:58:48 +02:00
Stefan Haller 1d65196136
Dont auto-forward branches that are checked out in another worktree (#4833)
### PR Description

This is similar to #2957, except that in that case it was about an
explicit fast-forward command, and we solved it by doing the
fast-forward in the other work-tree (so that it would fail if that
worktree had modified files, for example). In this case it is about the
relatively new auto-forward feature (added in v0.50, see #4493), and in
this case we fix it by not even trying to auto-forward any branches that
are checked out by other worktrees.
2025-08-20 10:45:24 +02:00
Stefan Haller 235ab15d7b Don't auto-forward branches that are checked out by another worktree 2025-08-20 10:43:19 +02:00
Stefan Haller 7130cb2947 Add test for auto-forwarding branches that are checked out by another worktree
The test shows that we are currently auto-forwarding branches even if they are
checked out by another worktree; this is quite bad, because when you switch to
that other worktree you'll see that the files that are touched by the fetched
commits are all modified (which we don't test here).
2025-08-20 10:43:19 +02:00
Stefan Haller 8beec9aacc
Add a user config for using git's external diff command for paging (#4832)
### PR Description

This is similar to using lazygit's `Git.Paging.ExternalDiffCommand`
config, except that the command is configured in git. This can be done
either with git's `diff.external` config, or through `.gitattributes`,
so it gives a bit more flexibility.

We could consider removing the `Git.Paging.ExternalDiffCommand` config
now, because its functionality is covered by the new config. I decided
to keep it though, because I don't want to make this a breaking change,
and also because some users might want to have the external diff command
only in lazygit but not on the command line.
2025-08-20 10:42:37 +02:00
Stefan Haller 40e989467f Add a user config for using git's external diff command for paging
This is similar to using lazygit's Git.Paging.ExternalDiffCommand config, except
that the command is configured in git. This can be done either with git's
`diff.external` config, or through .gitattributes, so it gives a bit more
flexibility.
2025-08-20 10:39:55 +02:00
Stefan Haller 86934ce1af
Remove the git.paging.useConfig option (#4837)
### PR Description

Many people don't understand what this means, which is apparent from the
amount of issues that got filed because of this. Let's get rid of it to
avoid this confusion. People will have to configure their pager twice if
they want to use it both on the command line and in lazygit, which I
think is not a big deal.

See
[here](https://github.com/jesseduffield/lazygit/issues/3704#issuecomment-2330772344)
for more rationale.

Closes #3704.
2025-08-20 10:39:21 +02:00