1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-12-15 23:51:36 +02:00
Commit Graph

7062 Commits

Author SHA1 Message Date
github-actions[bot]
b6168b363c README.md: Update Sponsors 2025-12-14 16:15:02 +00:00
Stefan Haller
3201695658 feat: add keys for command log menu items (#5096) 2025-12-14 17:14:50 +01:00
Peter Cardenas
a41bd6a255 feat: add keys for command log menu items 2025-12-14 17:12:47 +01:00
Stefan Haller
8651c46e14 Fix small issues with the Breaking Changes texts (#5114) 2025-12-11 21:13:30 +01:00
Stefan Haller
46c095cc29 Add a missing quote 2025-12-11 21:10:11 +01:00
Stefan Haller
9aa268c1f4 Cleanup: use spaces instead of tab 2025-12-11 21:09:57 +01:00
Stefan Haller
6600adf671 Remove confirmation for opening the merge tool (#5094)
The confirmation used to make sense back when the Open MergeTool command
was its own top-level command; however, that command was changed in
#4889 to open a menu instead, and Open MergeTool is now just a submenu
entry in that menu, so it no longer needs a confirmation.

Fixes #5093.
2025-12-08 09:48:58 +01:00
Stefan Haller
f6cba966d0 Remove confirmation for opening the merge tool
The confirmation used to make sense back when the Open MergeTool command was its
own top-level command; however, that command was changed in 703f053a7e to open a
menu instead, and Open MergeTool is now just a submenu entry in that menu, so it
no longer needs a confirmation.
2025-12-07 20:55:25 +01:00
Stefan Haller
17d03ec8cb Update docs and schema for release (#5091) v0.57.0 2025-12-06 13:58:23 +01:00
Stefan Haller
da4494fb06 Update docs and schema for release 2025-12-06 13:49:02 +01:00
Stefan Haller
8ced11b5ae README.md: Update Sponsors (#5055)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-12-06 13:48:26 +01:00
github-actions[bot]
d4c0c499b2 README.md: Update Sponsors 2025-12-06 12:30:25 +00:00
Stefan Haller
17c6a895b4 Update translations from Crowdin (#5090) 2025-12-06 13:30:13 +01:00
Stefan Haller
6fbf64b70e Update translations from Crowdin 2025-12-06 13:28:19 +01:00
Stefan Haller
cc96d8cede Fix to support creating MRs for repositories cloned with SSH alias (#5082)
### PR Description

Use case: some repositories are cloned with a full SSH alias (without a
user). E.g. in `.ssh/config` you have

```
Host gitlab
    HostName gitlab.com
    User git
    IdentityFile ...
```

and then you clone with `git clone gitlab:foo/bar`

According to the docs, you can add a service to `config.yaml` and it
should work:

```yaml
services:
  gitlab: 'gitlab:gitlab.com'
```

But currently it doesn't because lazygit expects all remote URLs to have
a user. This can be fixed by the user by changing the URL to e.g.
`git@gitlab:foo/bar`, but it breaks the user flow and is quite
unexpected.

This PR changes `defaultUrlRegexStrings` and makes the `user@` part of
the remote URL optional. Fixes the issue for Github and Gitlab which use
the default regexes.
2025-12-06 11:58:44 +01:00
Mikhail Akimov
d6ff7f152d Fix to support creating merge requests for Gitlab/Github repositories cloned with an SSH config alias 2025-12-06 11:52:55 +01:00
Stefan Haller
0fc8cb35a8 chore: fix function name in comment (#4481) 2025-12-06 11:45:51 +01:00
riyueguang
13b4e16e6a chore: fix function name in comment
Signed-off-by: riyueguang <rustruby@outlook.com>
2025-12-06 18:28:58 +08:00
Stefan Haller
06426b2107 refactor: use strings.Builder and strings.Repeat to simplify code (#5068)
### PR Description

strings.Builder has fewer memory allocations and better performance.
More info: [golang/go#75190](https://github.com/golang/go/issues/75190)
2025-12-03 18:39:11 +01:00
boqishan
89a0542a97 refactor: use strings.Builder and strings.Repeat to simplify code
Signed-off-by: boqishan <boqishan@126.com>
2025-12-03 18:34:21 +01:00
Stefan Haller
8396747cf1 Band-aid fix for rare crashes when refreshing files (#5074)
Users have filed issues with crash reports that seem to indicate that
the FileTreeViewModel gets swapped out (by a refresh) while a call to
itemsSelected is in progress, iterating over the previous items. Guard
against this by locking the mutex that we already have for this for the
duration of the call.

I don't have a good way of testing whether the fix helps, because the
crashes only occurred very infrequently. Let's just see if the crash
reports stop coming in after we ship this.

Note also that this is only the minimal fix for the crashes that were
reported. Theoretically, the same problem could happen for a key handler
itself, but we never saw reports about that, so we don't bother doing
anything about that yet.

Note also that long-term I envision a different solution to this class
of problems (discussed in
https://github.com/jesseduffield/lazygit/issues/2974), that's why I want
to avoid locking mutexes more than necessary now.

Fixes #3646 
Fixes #4154
Fixes #4301
Fixes #5070
2025-12-03 08:10:13 +01:00
Stefan Haller
d274474c61 Band-aid fix for rare crashes when refreshing files
Users have filed issues with crash reports that seem to indicate that the
FileTreeViewModel gets swapped out (by a refresh) while a call to itemsSelected
is in progress, iterating over the previous items. Guard against this by locking
the mutex that we already have for this for the duration of the call.

I don't have a good way of testing whether the fix helps, because the crashes
only occurred very infrequently. Let's just see if the crash reports stop coming
in after we ship this.

Note also that this is only the minimal fix for the crashes that were reported.
Theoretically, the same problem could happen for a key handler itself, but we
never saw reports about that, so we don't bother doing anything about that yet.

Note also that long-term I envision a different solution to this class of
problems (discussed in https://github.com/jesseduffield/lazygit/issues/2974),
that's why I want to avoid locking mutexes more than necessary now.
2025-12-03 08:08:21 +01:00
Stefan Haller
d1d2bb23b6 Show fixup base commits in correct order in ctrl-f error message (#5073)
If the ctrl-f command ("Find base commit for fixup") finds multiple
candidates, it lists them all in an error message. Previously they were
listed in random order in the error message, which can be confusing;
it's nicer to see them in the same order in which they appear in the
commit log.

Fixes #5071.
2025-11-30 14:08:22 +01:00
Stefan Haller
26453b26cf Remove unused function GetHashesAndCommitMessagesFirstLine 2025-11-30 14:06:31 +01:00
Stefan Haller
e2b3601c57 Fix order of fixup base commits shown in ctrl-f error message 2025-11-30 14:06:31 +01:00
Stefan Haller
c16b4b1d2e Make find_base_commit_for_fixup tests more specific
We want to test the order in which the commits are listed in the error message.
For one of the tests the order is already as we want it, but for the other it's
not (we want them to show up in log order). We'll fix this in the next commit.
2025-11-30 14:06:31 +01:00
Stefan Haller
28cd1c2df4 Don't use "HEADLESS" environment variable for running tests (#5064)
It is a bit generic, it seems that users sometimes set it for other
reasons (see
https://github.com/jesseduffield/lazygit/issues/5030#issuecomment-3541000735),
and then they are confused why they don't see anything. Use a more
specific name instead.
2025-11-28 12:09:17 +01:00
Stefan Haller
9334bf0333 Don't use "HEADLESS" environment variable for running tests
It is a bit generic, it seems that users sometimes set it for other reasons, and
then they are confused why they don't see anything. Use a more specific name
instead.
2025-11-28 12:06:42 +01:00
Stefan Haller
e3ea666352 Fix deleting a remote tag when a remote branch with the same name exists, or vice versa (#5075)
Nothing to add to the PR title here.

Fixes #5072.
2025-11-28 12:06:03 +01:00
Stefan Haller
11a6a73be5 Fix deleting a remote tag when a remote branch with the same name exists 2025-11-27 19:52:18 +01:00
Stefan Haller
7809823064 Fix deleting a remote branch when a remote tag with the same name exists 2025-11-27 19:51:24 +01:00
Stefan Haller
4d4b143cc7 Add tests demonstrating the problem
Trying to delete a remote tag when a remote branch with the same name exists
results in an error, and vice versa.
2025-11-27 19:51:13 +01:00
Stefan Haller
19a4454599 Cleanup: remove unnecessary keypress
Seems to be a copy/paste error from another test.
2025-11-27 19:32:22 +01:00
Stefan Haller
b57be9ebe4 Fix and speed up the file list for the "Enter path to filter by" feature (#5056)
The file suggestions list that appears when you choose "Enter path to
filter by" from the Filtering menu was previously implemented by walking
the file system to collect all files, and then filter out the ones that
are git-ignored. This approach had several problems:
- for certain .gitignore configurations there was a bug in the code that
filters out ignored files, causing the list to be empty. See
https://github.com/jesseduffield/lazygit/issues/2642#issuecomment-3554117172
for details.
- the list included files from submodules. While at first glance this
might sound useful, it doesn't work: choosing a file from the list shows
an empty log. Lazygit would have to switch to the submodule first to
show the log, which would be unexpected in the context of the Filtering
dialog, so it's better to not show these files, and require the user to
enter a submodule explicitly before they can filter on a file in it.
- it was rather slow.

This PR improves all these by using a call to `git ls-files` to list the
repositories files.

Here are some rough hand-timed measurements (from opening the Filtering
dialog until the file list shows) for various repos:

|                             | before | after          |
|:--------------------------- | ------:| -------------- |
| lazygit (3'200 files)       |    ~1s | not measurable |
| my work repo (90'000 files) |     7s | <1s            |
| llvm (150'000 files)        |     5s | ~1s            |

Fixes #2642
2025-11-21 07:59:58 +01:00
Stefan Haller
b06c2bb025 Remove the 'minimal' dependency which we no longer need 2025-11-21 07:57:56 +01:00
Stefan Haller
1c1676a5d9 Use git ls-files to list all file suggestions 2025-11-21 07:57:56 +01:00
Stefan Haller
9d24963ea0 Bump golang.org/x/crypto from 0.37.0 to 0.45.0 (#5054)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from
0.37.0 to 0.45.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4e0068c009"><code>4e0068c</code></a>
go.mod: update golang.org/x dependencies</li>
<li><a
href="e79546e28b"><code>e79546e</code></a>
ssh: curb GSSAPI DoS risk by limiting number of specified OIDs</li>
<li><a
href="f91f7a7c31"><code>f91f7a7</code></a>
ssh/agent: prevent panic on malformed constraint</li>
<li><a
href="2df4153a03"><code>2df4153</code></a>
acme/autocert: let automatic renewal work with short lifetime certs</li>
<li><a
href="bcf6a849ef"><code>bcf6a84</code></a>
acme: pass context to request</li>
<li><a
href="b4f2b62076"><code>b4f2b62</code></a>
ssh: fix error message on unsupported cipher</li>
<li><a
href="79ec3a51fc"><code>79ec3a5</code></a>
ssh: allow to bind to a hostname in remote forwarding</li>
<li><a
href="122a78f140"><code>122a78f</code></a>
go.mod: update golang.org/x dependencies</li>
<li><a
href="c0531f9c34"><code>c0531f9</code></a>
all: eliminate vet diagnostics</li>
<li><a
href="0997000b45"><code>0997000</code></a>
all: fix some comments</li>
<li>Additional commits viewable in <a
href="https://github.com/golang/crypto/compare/v0.37.0...v0.45.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/crypto&package-manager=go_modules&previous-version=0.37.0&new-version=0.45.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/jesseduffield/lazygit/network/alerts).

</details>
2025-11-20 08:26:55 +01:00
dependabot[bot]
1b60c9d7c6 Bump golang.org/x/crypto from 0.37.0 to 0.45.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.37.0 to 0.45.0.
- [Commits](https://github.com/golang/crypto/compare/v0.37.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-20 02:01:56 +00:00
Stefan Haller
11c7203db6 Switch to branches view when checking out a commit (#5048)
We move the code to push the branches context into CheckoutRef, this way
it works consistently no matter where we call it from. Previously,
checking out remote branches or tags would switch to the branches view,
but checking out a commit did not.

Note that it now also takes effect for undoing or redoing a checkout,
which may be a bit questionable; but I still think it makes sense for
this, too.
2025-11-16 21:28:22 +01:00
Stefan Haller
221e025ee6 Switch to branches view when checking out a commit
We move the code to push the branches context into CheckoutRef, this way it
works consistently no matter where we call it from. Previously, checking out
remote branches or tags would switch to the branches view, but checking out a
commit did not.

Note that it now also takes effect for undoing or redoing a checkout, which may
be a bit questionable; but I still think it makes sense for this, too.
2025-11-16 21:23:40 +01:00
Stefan Haller
e3a09eacd1 Cleanup: reformat
We usually put Lines() on a line by itself, and it makes the diff of the next
commit much easier to read.
2025-11-16 19:10:21 +01:00
Stefan Haller
9f930eee06 Trigger immediate background fetch when switching repos (#5047)
If background fetching is on (which it is by default), we usually run
the first background fetch right after opening lazygit, which is nice
because it immediately fetches all the stuff that's new. However, when
switching to a different repo from within lazygit (either with the
recent repos menu or by going into or out of a submodule) we didn't do
that, and you'd have to wait for the next regular background fetch to
come along. I'm finding myself pressing `f` in the Files panel to
manually fetch after entering a submodule, and I shouldn't have to do
that.

This PR makes it so that when you switch repos, we trigger a background
fetch immediately (unless the last one for this repo was less than the
auto-fetch interval ago, in which case it's unnecessary).
2025-11-16 17:37:12 +01:00
Stefan Haller
2af56de5d2 Trigger background fetch on repo switch only if enough time has passed since the last one 2025-11-16 17:32:37 +01:00
Stefan Haller
d45f27b6ee Add methods for converting RefresherConfig times to time.Durations 2025-11-16 17:32:37 +01:00
Stefan Haller
472b964da3 Cleanup: don't pass refreshInterval to startBackgroundFilesRefresh
It has access to UserConfig, so it can easily get it from there. This is how we
do it for startBackgroundFetch too, so be consistent.
2025-11-16 17:32:37 +01:00
Stefan Haller
aff6b642ea Trigger immediate background fetch when switching repos 2025-11-16 17:32:37 +01:00
Stefan Haller
8f4bf49aff Cleanup: remove unused field 2025-11-16 17:32:37 +01:00
Stefan Haller
ce7622262f feat: add fork remote command (#4831)
The command allows you to quickly add a fork remote by replacing the
owner in the origin URL and optionally check out a branch from new
remote.

Examples:

* given url: `https://github.com/jesseduffield/lazygit.git`
  and username: `karolzwolak`
  
adds a new remote with url: `https://github.com/karolzwolak/lazygit.git`
  
  
* given url: `https://github.com/jesseduffield/lazygit.git`
  and username: `karolzwolak:add-fork-remote-command`
  
adds a new remote with url: `https://github.com/karolzwolak/lazygit.git`
  and then checks out it's branch `add-fork-remote-command`
2025-11-16 17:28:11 +01:00
Karol Zwolak
3892c40666 feat: add fork remote command
The command allows you to quickly add a fork remote by replacing the owner in the origin URL and optionally check out a branch from new remote.
2025-11-16 17:26:00 +01:00
Stefan Haller
ba632d4064 Update table of contents in README.md (#5045)
### PR Description
Adding and fixing some links in the table of contents of the README.
2025-11-16 09:10:54 +01:00