1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-08 22:36:49 +02:00
Commit Graph

6646 Commits

Author SHA1 Message Date
Stefan Haller
9650753db6 Add configuration hints to existing tooltips 2025-07-09 13:16:42 +02:00
Stefan Haller
0d4f0e827d Add breaking changes entry for the changed sort order for branches 2025-07-09 13:15:03 +02:00
Stefan Haller
3575bb9859 Add enum validation for Git.Log.Order and Git.Log.ShowGraph 2025-07-09 13:15:03 +02:00
Stefan Haller
562a2aaa6b Un-deprecate UserConfig.Git.Log.Order and ShowGraph
And remove them from AppState.
2025-07-09 13:15:03 +02:00
Stefan Haller
703256e92d Move LocalBranchSortOrder and RemoteBranchSortOrder to user config
At the same time, we change the defaults for both of them to "date" (they were
"recency" and "alphabetical", respectively, before). This is the reason we need
to touch so many integration tests. For some of them I decided to adapt the test
assertions to the changed sort order; for others, I added a SetupConfig step to
set the order back to "recency" so that I don't have to change what the test
does (e.g. how many SelectNextItem() calls are needed to get to a certain
branch).
2025-07-09 13:15:03 +02:00
Stefan Haller
d79283656d Add missing validation tests 2025-07-09 13:15:03 +02:00
Stefan Haller
f318e45e9d Move DiffContextSize and RenameSimilarityThreshold to user config 2025-07-09 13:15:03 +02:00
Stefan Haller
8d7bfd131e Move IgnoreWhitespaceInDiffView to user config
When toggling the value in the UI we simply overwrite the value in UserConfig;
this would be bad if there was ever a chance that we want to write the user
config back to disk, but it is very unlikely that we can do that, because
currently we have no way to tell which parts of the config come from the global
config file and which ones come from a repo-local one.
2025-07-09 13:15:03 +02:00
Stefan Haller
f3164afa1e Fix keybinding display for local branches sort order to indicate it's a menu 2025-07-09 13:15:03 +02:00
Stefan Haller
5a5ffb3204 Bump minimum required git version to 2.32 (#4718) 2025-07-09 13:14:24 +02:00
Stefan Haller
c739357eb9 Remove git version specific code for versions we no longer support 2025-07-09 12:18:58 +02:00
Stefan Haller
93c5849c86 Remove obsolete git version restrictions 2025-07-09 12:18:57 +02:00
Stefan Haller
6a9fe2e604 Remove obsolete tests
These only ran for git versions that we no longer support.
2025-07-09 12:18:57 +02:00
Stefan Haller
e27422f894 Bump minimum required git version to 2.32
The version choice is a little arbitrary, but see discussion at
https://github.com/jesseduffield/lazygit/pull/4559#issuecomment-2876201680.

The main reason why I'm updating the version now is that versions before 2.27
had a bug with branch sorting, where sorting by -committerdate (which will be
our default soon) would sort branches that point at the same commit in reverse
alphabetical order rather than alphabetical order. While this is only slightly
annoying but not a huge deal for users, it makes maintaining our integration
tests across versions very hard. So I wanted to update to at least 2.27 to get
around this problem, and went with 2.32 after the discussion linked to above.

The choice of which versions to run integration tests on is pretty arbitrary
too, I just picked some at random which are about 5 to 6 minor versions apart.
2025-07-09 12:18:57 +02:00
Stefan Haller
a1a2925c9c Remove obsolete git version restriction in test
We have been requiring 2.22 for a while now.
2025-07-09 11:15:45 +02:00
Stefan Haller
0a1ddba1d9 Add confirmation for hard reset (#4704)
- **PR Description**

Doing a hard reset is really destructive because it loses all
uncommitted changes, so add a confirmation in case there are any.

Fixes #3085
Fixes #3709
Fixes #4688
2025-07-08 16:45:35 +02:00
Stefan Haller
7153305174 Add confirmation for hard reset when there are uncommitted changes 2025-07-08 16:41:22 +02:00
Stefan Haller
f872912c07 Use ConfirmIf where applicable 2025-07-08 16:41:22 +02:00
Stefan Haller
20600b9b5c Add convenience function ConfirmIf
It's a very common pattern in the code base to have some code that we want to
run either directly, or with a confirmation, depending on some condition. In
most cases this is solved by creating a local helper function that we call
either directly or from within the HandleConfirm of the confirmation; provide a
convenience helper that makes this easier.
2025-07-08 16:41:22 +02:00
Stefan Haller
1ca5f09827 Remove deprecated edit configs (#4716)
They were deprecated in April 2023 (see 046b0d9daa), so it's been well
over a year now.
2025-07-08 16:35:31 +02:00
Stefan Haller
73bf49f8d8 Remove deprecated edit configs
They were deprecated in April 2023 (see 046b0d9daa), so it's been well over a
year now.
2025-07-08 16:32:21 +02:00
Stefan Haller
41efd9a027 Use non-deprecated 'OS.Open' config in OpenFile test on Windows
This should have been changed in e4e16fa38e.
2025-07-08 16:32:21 +02:00
Stefan Haller
143134fafc Remove unused code and texts (#4715)
- **PR Description**

Remove some unused code, in particular a lot of unused texts from the
TranslationSet.
2025-07-08 16:03:08 +02:00
Stefan Haller
8f48ad7572 Remove unused TranslationSet fields
These were found by commenting out the initialization of the struct literal in
EnglishTranslationSet.TranslationSet(), and then running

$ punused pkg/i18n/**/*.go

Punused can be installed with `go install github.com/bep/punused@latest`.
2025-07-08 15:54:07 +02:00
Stefan Haller
de19802cfb Fix wrong text being used in error message
The code was copied from StagingController in 0496e3af50, and I did add the new
text in that commit, I just forgot to adapt the code to actually use it.
2025-07-08 15:28:01 +02:00
Stefan Haller
28bb6a0e80 Remove some unused code 2025-07-08 15:14:45 +02:00
Stefan Haller
5587d70ec9 Fix scrolling hunk into view when selecting next hunk (#4709)
- **PR Description**

If the hunk to be selected was partially scrolled offscreen, the view wouldn't
scroll enough to make it completely visible (the last line of the hunk was still
offscreen).
2025-07-07 13:47:58 +02:00
Stefan Haller
63655288a4 Fix scrolling hunk into view when selecting next hunk
If the hunk to be selected was partially scrolled offscreen, the view wouldn't
scroll enough to make it completely visible (the last line of the hunk was still
offscreen).

This is only a minimal fix for a pressing problem. The code to handle scrolling
after selection changes has lots of problems, and is also inconsistent between
list views and the patch explorer, but cleaning this up needs more time than I
have right now.
2025-07-07 13:42:10 +02:00
Stefan Haller
29fc46dc62 Cleanup: remove unused method Focus from PatchExplorerContext 2025-07-07 13:37:41 +02:00
Stefan Haller
3f546f7269 Cleanup: fix comment 2025-07-07 13:37:41 +02:00
Stefan Haller
79f69536ed Clean up the .gitignore file (#4706)
Globally ignoring all dot files and then making exceptions as needed to pull
files back in again is very error prone. It's better to explicitly exclude
everything we want to hide.

The reason why this came up is that I tried to look at the git history of one of
the files in .github/workflows/ using lazygit's path filtering feature, but it
didn't show up in the list of suggestions. It took me a while to realize that
that's because this list doesn't show git-ignored files. Now, .github/workflows/
wasn't really git-ignored because it was brought back by an exclamation mark
entry in the Exceptions section; but maybe the library we are using to get the
files doesn't handle these properly or something (I didn't further research
this).
2025-07-06 16:19:15 +02:00
Stefan Haller
f8865c4182 Bring back files from vendor directory that we accidentally excluded 2025-07-06 16:13:17 +02:00
Stefan Haller
59b68f9794 Clean up .gitignore
Globally ignoring all dot files and then making exceptions as needed to pull
files back in again is very error prone. It's better to explicitly exclude
everything we want to hide.

This can be seen in the vendor directory, where we omitted a lot of files
accidentally (we'll fix that in the next commit). None of these were important,
so no harm done, but still.

The reason why this came up is that I tried to look at the git history of one of
the files in .github/workflows/ using lazygit's path filtering feature, but it
didn't show up in the list of suggestions. It took me a while to realize that
that's because this list doesn't show git-ignored files. Now, .github/workflows/
wasn't really git-ignored because it was brought back by an exclamation mark
entry in the Exceptions section; but maybe the library we are using to get the
files doesn't handle these properly or something (I didn't further research
this).
2025-07-06 16:13:17 +02:00
Stefan Haller
528367b4e8 Remove the homebrew tap from the readme (#4705)
The core homebrew formular is usually up to date very quickly, so
there's little reason to use the custom tap.

We still maintain the tap and update it for the benefit of users who
already subscribed to it, but we no longer recommend it for new users.
2025-07-06 15:25:36 +02:00
Stefan Haller
9efd4f2e73 Remove the homebrew tap from the readme
The core homebrew formular is usually up to date very quickly, so there's little
reason to use the custom tap.

We still maintain the tap and update it for the benefit of users who already
subscribed to it, but we no longer recommend it.
2025-07-06 15:18:15 +02:00
Stefan Haller
1d80730757 Update release workflow (#4703)
- **PR Description**

Make the action run only in my fork, so that releases appear to be
created by me.

Also, update goreleaser to the latest version, and some other tweaks.
2025-07-06 12:31:00 +02:00
Stefan Haller
05d1a7a804 Make it run at 8am instead of in the middle of the night
This gives me a chance to react if necessary, e.g. by tweaking the release
notes, or by deleting it again if something went wrong.
2025-07-06 12:08:25 +02:00
Stefan Haller
db3a23a11c Create annotated tags
They are preferable over lightweight tags because they carry information about
who created them, and when.
2025-07-06 12:08:25 +02:00
Stefan Haller
f735c6af17 Make the release workflow run only from stefanhaller's fork
As far as I can tell, this is the only way to make sure that releases show up as
created by me. Also, we totally don't want it to run in other people's forks
(although it would likely just have failed there, but still).

The restriction only applies to scheduled runs; manually triggering the action
is still possible from everywhere. There needs to be a personal access token
named LAZYGIT_RELEASE_PAT configured on the repo for this to work, though.
2025-07-06 12:08:25 +02:00
Stefan Haller
7ef8385f2e Set a default shell for all jobs
Setting the shell to 'bash' turns on -e and -o pipefail, both of which are very
desirable to have.

https://github.com/actions/runner-images/issues/4459#issuecomment-965290856
2025-07-06 11:59:02 +02:00
Stefan Haller
2659a8cd90 Update goreleaser to v2 2025-07-06 11:59:02 +02:00
Stefan Haller
67537c2356 README.md: Update Sponsors (#4702)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-07-06 11:57:51 +02:00
github-actions[bot]
70e92d210a README.md: Update Sponsors 2025-07-06 09:55:07 +00:00
Jesse Duffield
4221078afe Remove redundant curlies (#4701)
- **PR Description**

- **Please check if the PR fulfills these requirements**

* [ ] Cheatsheets are up-to-date (run `go generate ./...`)
* [ ] Code has been formatted (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
* [ ] Tests have been added/updated (see
[here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)
for the integration test guide)
* [ ] Text is internationalised (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation))
* [ ] If a new UserConfig entry was added, make sure it can be
hot-reloaded (see
[here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig))
* [ ] Docs have been updated if necessary
* [ ] You've read through your own file changes for silly mistakes etc

<!--
Be sure to name your PR with an imperative e.g. 'Add worktrees view',
and make sure the title
is suitable to be included as a bullet point in release notes (i.e.
phrased from a user's point
of view).
see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for
examples
-->
2025-07-06 19:54:53 +10:00
Jesse Duffield
cea7d1b4d0 Remove redundant curlies 2025-07-06 19:54:31 +10:00
Jesse Duffield
026a3583da Properly use sponsors PR token (#4700)
- **PR Description**

- **Please check if the PR fulfills these requirements**

* [ ] Cheatsheets are up-to-date (run `go generate ./...`)
* [ ] Code has been formatted (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
* [ ] Tests have been added/updated (see
[here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)
for the integration test guide)
* [ ] Text is internationalised (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation))
* [ ] If a new UserConfig entry was added, make sure it can be
hot-reloaded (see
[here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig))
* [ ] Docs have been updated if necessary
* [ ] You've read through your own file changes for silly mistakes etc

<!--
Be sure to name your PR with an imperative e.g. 'Add worktrees view',
and make sure the title
is suitable to be included as a bullet point in release notes (i.e.
phrased from a user's point
of view).
see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for
examples
-->
2025-07-06 19:43:14 +10:00
Jesse Duffield
878f762b6f Properly use sponsors PR token 2025-07-06 19:43:00 +10:00
Jesse Duffield
212ceffb4d Use fine-grained sponsors PR token (#4699)
This uses a fine-grained token

- **PR Description**

- **Please check if the PR fulfills these requirements**

* [ ] Cheatsheets are up-to-date (run `go generate ./...`)
* [ ] Code has been formatted (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
* [ ] Tests have been added/updated (see
[here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)
for the integration test guide)
* [ ] Text is internationalised (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation))
* [ ] If a new UserConfig entry was added, make sure it can be
hot-reloaded (see
[here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig))
* [ ] Docs have been updated if necessary
* [ ] You've read through your own file changes for silly mistakes etc

<!--
Be sure to name your PR with an imperative e.g. 'Add worktrees view',
and make sure the title
is suitable to be included as a bullet point in release notes (i.e.
phrased from a user's point
of view).
see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for
examples
-->
2025-07-06 19:38:59 +10:00
Jesse Duffield
955d4dd80c Use fine-grained sponsors PR token
This uses a fine-grained token
2025-07-06 19:38:29 +10:00
Stefan Haller
b134763348 Try using PAT on sponsors CI (#4697) 2025-07-06 11:34:11 +02:00