1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-12 13:21:42 +03:00
Commit Graph

6671 Commits

Author SHA1 Message Date
28bb6a0e80 Remove some unused code 2025-07-08 15:14:45 +02:00
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
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
29fc46dc62 Cleanup: remove unused method Focus from PatchExplorerContext 2025-07-07 13:37:41 +02:00
3f546f7269 Cleanup: fix comment 2025-07-07 13:37:41 +02:00
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
f8865c4182 Bring back files from vendor directory that we accidentally excluded 2025-07-06 16:13:17 +02:00
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
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
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
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
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
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
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
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
2659a8cd90 Update goreleaser to v2 2025-07-06 11:59:02 +02:00
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
70e92d210a README.md: Update Sponsors 2025-07-06 09:55:07 +00:00
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
cea7d1b4d0 Remove redundant curlies 2025-07-06 19:54:31 +10:00
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
878f762b6f Properly use sponsors PR token 2025-07-06 19:43:00 +10:00
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
955d4dd80c Use fine-grained sponsors PR token
This uses a fine-grained token
2025-07-06 19:38:29 +10:00
b134763348 Try using PAT on sponsors CI (#4697) 2025-07-06 11:34:11 +02:00
7753659c2a Try using PAT on sponsors CI 2025-07-06 19:28:15 +10:00
aa55ddd1e0 Update the peter-evans/create-pull-request action to v7 (#4695)
This is needed for the draft: always-true setting.
2025-07-06 11:05:46 +02:00
f80860f8db Update the peter-evans/create-pull-request action to v7
This is needed for the draft: always-true setting.
2025-07-06 11:00:55 +02:00
89c3057a9f Raise sponsors PRs as a draft (#4694)
See

https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
2025-07-06 10:56:20 +02:00
48c3f347ce Move if to job level so that the entire thing doesn't run in forks 2025-07-06 10:51:46 +02:00
80da133a1a Raise sponsors PRs as a draft
See
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
2025-07-06 18:42:20 +10:00
4d831b55b6 Fix broken markdown in auto-generated keybindings documentation (#4690)
- **PR Description**

This PR fixes the broken markdown table formatting in the auto-generated
keybindings documentation files by properly escaping newlines in
tooltips.
Issue: https://github.com/jesseduffield/lazygit/issues/4689
2025-07-06 10:16:48 +02:00
b11da414c5 fix: broken markdown by replace \n into <md> 2025-07-06 10:11:49 +02:00
bc4b50f817 Add user config to use hunk mode by default when entering staging view (#4685)
- **PR Description**

As of #4684, hunk mode has become so useful that I prefer it over line
mode now. This PR adds a config that lets you use hunk mode by default
in the staging view.

I'm not enabling this by default yet, although I do think it's the more
useful mode for most people. The biggest issue that I still have with
this is that _if_ you need to switch to line mode for some reason, then
it's very non-obvious how to do that. New users might not find out at
all, and think that lazygit doesn't allow staging individual lines.
v0.53.0
2025-07-04 19:46:36 +02:00
0a73123a66 Escape out of hunk mode only if it was turned on by the user
If hunk mode is on by default because of the config, then it's annoying for
escape to go to line mode.
2025-07-04 19:41:40 +02:00
2961c991a4 Add user config to use hunk mode by default when entering staging view 2025-07-04 19:41:40 +02:00
a6001dc76e Cleanup: rename a badly named function
We used the term "change line" to mean "a line that was added or deleted", but
it sounded like a verb in the function name.
2025-07-04 19:41:39 +02:00
9f23b89e90 Improve hunk selection mode in staging view (#4684)
- **PR Description**

Hunk selection mode is one of the features that many people don't know
about, because it is not very discoverable. You can switch to it from
line selection mode by pressing `a` in the staging view.

The problem with this mode is that it selects entire hunks, where hunks
are defined to be sections of the diff starting with `@@`. Very often,
hunks consist of multiple distinct blocks of changes, separated by
context lines. For example, with the default diff context size of 3 it
takes at least 6 unchanged lines between blocks of changes for them to
be separated into distinct hunks; if there are 5 or less unchanged lines
between them, they are grouped into one hunk. And of course, if you
increase the diff context size by pressing `}`, you will get even fewer
hunks.

Now, most of the time I want to navigate between the individual blocks
of changes in a diff, regardless of how git groups them into hunks.
That's what this PR does: when pressing `a`, the selection is extended
to just the current group of changes, separated by context lines; you
can easily stage it by pressing space, and the selection will move on to
the next block of changes. Actual hunks no longer play a role here.
Also, in line selection mode the right/left arrow keys now move between
blocks of changes rather than actual hunks.

I find this new behavior so useful that I almost always switch to hunk
mode right away after entering the staging view. It saves a lot of
keystrokes, since it is very rare that I want to select only some lines
of a block of adjacent changes. This makes me wonder whether we should
enable hunk mode by default when entering staging, but that's going to
be another PR.
2025-07-04 19:37:48 +02:00
a6096f4702 In hunk staging mode, select blocks of changes rather than actual hunks
Also, pressing right or left arrow moves between blocks of changes rather than
actual hunks. I find this to be much more useful.
2025-07-04 19:31:35 +02:00
08ad8a0b2d Don't generate test list before running integration test
It's annoyingly slow, and there is a separate task for generating the list if
needed.

Also, clear the terminal before running the test; this makes it easier to see
the results of the last test run.
2025-07-04 18:26:45 +02:00
3ea4cf0b63 Update translations from Crowdin (#4686)
- **PR Description**

Update translations from Crowdin
2025-07-04 18:25:19 +02:00
9290c074f7 Update translations from Crowdin 2025-07-04 18:22:13 +02:00
ca06ce6100 Collapse selection after deleting a range of branches or stashes (#4661)
- **PR Description**

Fixes selection state persistence after deletion by resetting selection
mode.
Resolves [#4612](https://github.com/jesseduffield/lazygit/issues/4612)
2025-07-04 17:34:33 +02:00
bc0cddf03d Collapse selection after deleting a range of stashes 2025-07-04 17:28:29 +02:00
4b33efffbe Collapse selection after deleting a range of remote branches
We only want to do this when the function is called from the remote branches
panel. It can also be called with a selection of local branches in order to
delete their remote branches, but in this case the selection shouldn't be
collapsed because the local branches stay around.
2025-07-04 17:20:22 +02:00
80a614d330 Fix collapsing the range selection after deleting branches
We had code already that was supposed to do this, but it didn't work. It should
have used SetSelection() instead of SetSelectedLineIdx(); the latter doesn't
actually cancel a range selection.

Introduce a new function specifically for collapsing the range after deleting
multiple items, so that clients don't need two calls (we'll add a bunch more in
this branch).
2025-07-04 17:18:10 +02:00
61ff8a4da8 Move to next stageable line when adding a line to a custom patch (#4675)
- **PR Description**

While it's true that the behavior is a little different from the staging
panel, where the staged lines are actually removed from the view and in
many cases the selection stays more or less in the same place, it is
still very useful to move to the next stageable thing in the custom
patch building view too.

Also, we change the visualization of what's included in the patch to
mark only the + and - lines of the patch; for all other lines it doesn't
make a difference whether they are included.

And finally, we make it so that only + and - lines are considered when
pressing space; previously it would also look at selected context lines,
which doesn't make much sense. This improves the experience for mouse
users who like to generously select hunks by dragging across them,
including some context lines above and below.
2025-07-04 10:16:45 +02:00
039831a27a Move to next stageable line after adding a line to a custom patch
While it's true that the behavior is a little different from the staging panel,
where the staged lines are actually removed from the view and in many cases the
selection stays more or less in the same place, it is still very useful to move
to the next stageable thing in the custom patch building view too.
2025-07-04 10:14:35 +02:00
ce9fbe58b2 Toggle only added/deleted lines in patch building view
This improves the experience when selecting a hunk generously with the mouse, by
dragging over it including some context lines above and below. Previously we
would consider the "moving end" of the selection range for whether things need
to be added or removed, but this doesn't make sense if it's a context line. Now
we consider the first actual change line that is included in the range.
2025-07-04 10:14:35 +02:00
ef1a141347 Export PatchLine.isChange 2025-07-04 10:14:35 +02:00