Commit Graph
100 Commits
Author SHA1 Message Date
Stefan Haller 88dae1d8b9 Refactor commit loading and reflog commit loading to extract shared code
These are very similar in that they call RunAndProcessLines on a git log command
and then process lines to create commits. Extract this into a common helper
function. At the moment this doesn't gain us much, but in the next commit we
will extend this helper function considerably with filter path logic, which
would otherwise have to be duplicated in both places.
2025-07-27 12:05:41 +02:00
Stefan Haller e7c33a7a65 Always append -- to git show command
It is good practice to use a -- argument even if no further arguments follow.
Doesn't really make a difference for this particular command though, I think.
2025-07-27 12:05:41 +02:00
Stefan Haller 33a4fdf0ee Remove unnecessary setSubCommits indirection
I don't know why this function argument was added, but I don't like unnecessary
indirections, so I'm removing it as SubCommitsHelper has access to everything it
needs to do it itself.
2025-07-27 12:05:41 +02:00
Stefan Haller e1d728ee5e Fix showing only filtered reflog entries when filtering by path
Recycle reflog commits only for the non-filtered ones.

If we're not filtering, FilteredReflogCommits and ReflogCommits are the same. If
we then enter filtering and get reflog entries again, and pass a
lastReflogCommit, we'd recycle the previous FilteredReflogCommits, which are
unfiltered, so that's no good. Work around this by simply never using the
recycle mechanism when getting the filtered reflog commits.

We could do better by remembering what the last filter path or author was, and
only suppressing the recycling when it changed; but that's more complexity than
I want to add, so hopefully this is good enough.
2025-07-27 12:05:41 +02:00
Stefan Haller 934276ac40 Use the non-filtered reflog for undoing
Using the filtered one is probably not a good idea. It didn't do much harm
because the split of ReflogCommits and FilteredReflogCommits doesn't really work
right now (FilteredReflogCommits is always the same as ReflogCommits, even in
filtering mode), but we'll fix this in the next commit.
2025-07-27 12:05:41 +02:00
Stefan Haller d99ceb91ee Don't get reflog commits twice unnecessarily in filtering mode
I can only guess what happened here: in aa750c0819, this code to manually load
the reflog commits was added, to make sorting branches by recency work when the
reflog is filtered by path. At that time we didn't have separate ReflogCommits
and FilteredReflogCommits models yet. Then, FilteredReflogCommits was introduced
(in 8822c409e2), probably for the very purpose of being able to get rid of this
again; but then it was forgotton to actually get rid of it.

The funny thing is that the introduction of FilteredReflogCommits happened in
the very next commit, 15 minutes later.
2025-07-27 12:05:41 +02:00
Stefan Haller 92b5bad29d Cleanup: simplify git arguments for reflog loading
The combination of --abbrev=40 and %h can be shortened to %H.
2025-07-27 12:05:41 +02:00
Stefan Haller 8515c74722 Add test that demonstrates problem with showing filtered history of file with renames
The test shows that selecting a commit before the rename shows an empty diff,
and selecting the rename itself shows an added file rather than a rename.
2025-07-27 12:05:41 +02:00
Stefan HallerandGitHub b8dfba8b3d Several small fixes to filtering mode (by path or author) (#4749)
- Refresh views properly when entering/exiting filtering mode
- Fix filtering of stashes
2025-07-27 12:05:18 +02:00
Stefan Haller ec82e7c1e7 Make stash filtering work when filtering on a folder 2025-07-27 12:03:06 +02:00
Stefan Haller 09cbaf2cba Make stash loading work in filtering mode
This broke with the introduction of the age in the stashes list in bc330b8ff3
(which was included in 0.41, so 12 minor versions ago).

This makes it work again when filtering by file, but it still doesn't work when
filtering by folder (and never has). We'll fix that next.
2025-07-27 12:03:06 +02:00
Stefan Haller 0dfa078653 Revert "chore: use null char as a stash entries divider during loading"
This was not a good idea, and it seems it has never been tested: the --name-only
and -z options don't work well together. Specifically, -z seems to simply cancel
--name-only.

This is not enough to make it work, we'll need more fixes in the next commit.

This reverts commit 50044dd5e0.
2025-07-27 12:03:06 +02:00
Stefan Haller ea84d5ee96 Add integration test for filtering the stashes list by file path
The test shows that it doesn't work, the list is empty both when filtering by
file and by folder.

I could have added test cases for these to the unit tests in
stash_loader_test.go instead, but I don't find tests that need to mock git's
output very valuable, so I opted for an integration test even though it takes
much longer to run.
2025-07-27 12:03:06 +02:00
Stefan Haller 5e65e8e0ea Refresh all affected scopes when entering/exiting filtering
Since filtering switches to half-screen mode in the local commits panel, most
people probably didn't notice, but we do also filter those other views. So when
leaving half-screen mode (but not filtering), you could switch to sub-commits or
stashes, and those would show the filtered view only after the next refresh
(e.g. after a background fetch). It's worse when leaving filtering, because this
goes back to normal screen mode, and you would often see an empty stashes panel
after that (until the next background fetch), which is quite confusing.

I also find it questionable to always switch focus to the commits panel when
entering filtering. If it is initiated from subcommits, reflog, or stashes,
maybe we want to stay there. I'm not changing this now since I'm unsure how much
people rely on the current behavior.
2025-07-27 12:03:06 +02:00
Stefan Haller 5307999874 Allow passing SUB_COMMITS scope to Refresh when no subcommits view is showing
We don't currently do this, but will in the next commit; it's a reasonable thing
to want to do, and it shouldn't crash.
2025-07-27 12:03:06 +02:00
Stefan Haller e5c39d5401 Fix visual regression when exiting filtering mode
When exiting filtering mode while the focus is not in the local commits panel,
the call to HandleFocus would render the selection in the commits panel as if
the panel had the focus.

The call to HandleFocus was introduced recently in 4981419ba9 in an attempt to
rerender the main view correctly, but it should only have been called when local
commits is the focused context. But instead, we can use PostRefreshUpdate, which
handles this distinction.
2025-07-27 12:03:06 +02:00
Stefan HallerandGitHub 143d4760fd Use a better way of pinning the version of golangci-lint (#4733)
- **PR Description**

Instead of requiring the user to install the right version of the tool
in their .bin folder, create a shim that automatically runs the right
version of the tool. This has several benefits:
- it works out of the box with no setup required (the tool will be
automatically downloaded and compiled the first time it is used)
- no work needed for developers when we bump the golangci-lint version
- it works in working copies that are used in different environments
(e.g. locally on a Mac, or inside a dev container)

Approach suggested by @kyu08.
2025-07-18 18:31:34 +02:00
Stefan Haller 37d5aeea8b Remove unnecessary golangci-lint install step from dev-container Dockerfile 2025-07-18 15:36:43 +02:00
Stefan Haller c8a1e894e0 Remove unused script lint.sh 2025-07-18 15:33:23 +02:00
Stefan Hallerandkyu08 38fc107f94 Use a better way of pinning the version of golangci-lint
Instead of requiring the user to install the right version of the tool in their
.bin folder, create a shim that automatically runs the right version of the
tool. This has several benefits:
- it works out of the box with no setup required (the tool will be automatically
  downloaded and compiled the first time it is used)
- no work needed for developers when we bump the golangci-lint version
- it works in working copies that are used in different environments (e.g.
  locally on a Mac, or inside a dev container)

Co-authored-by: kyu08 <49891479+kyu08@users.noreply.github.com>
2025-07-18 15:33:23 +02:00
Stefan HallerandGitHub d159b28dc0 Support Alt+Backspace for word deletion in text areas (#4741)
- **PR Description**
Add support for Alt+Backspace (Option+Backspace on macOS) to delete
entire words in text input areas, matching common text editor behavior.
2025-07-17 19:20:52 +02:00
Stefan HallerandGitHub 1210a645ef Fix amending commits whose commit message is empty (#4732)
- **PR Description**

When the commit message is empty, the `--amend` command will produce an error.
Solution: Add the `--allow-empty-message` option.
2025-07-14 18:00:12 +02:00
Stefan HallerandGitHub 9625ee8a59 Add confirmation for nuking the working tree (#4727)
- **PR Description**

This is a small PR that extends the logic added in
https://github.com/jesseduffield/lazygit/pull/4704

There were many reports of users accidentally resetting the working tree
using the reset commands and a nice change was added by @stefanhaller to
prompt for confirmation on those actions but the "Nuke working tree"
option was not covered by the PR.

I believe this one is actually one of the most important options to
prompt because it's by default the first one on the list. I myself
triggered it once when trying to discard a single file while unknowingly
having caps-lock enabled as I thought I was confirming the single file
discard option.
2025-07-13 15:01:22 +02:00
Stefan HallerandGitHub 1795cb9315 Add new command "Checkout previous branch" (#4728)
## **PR Description**
I added a new feature to checkout to the last branch.
I think it would be convenient to be able to checkout to the last branch
with just one key stroke(`-`) in some cases, such as when switching
between multiple branches during code review.

Off course, I know that you can same thing by entering `"-"` to the text
input of "Checkout by name" or using custom command but I think `git
checkout -` is occasional use case. So I feel this feature can be a part
of default features.

Another advantage of this feature is that you can checkout to the last
branch regardless of cursor position.
Being able to switch branches without worrying about cursor position
reduces stress I think.
2025-07-12 18:20:11 +02:00
Stefan HallerandGitHub 7d92260050 Fix commit searching during rebase or in divergence from upstream view (#4730)
- **PR Description**

Fix search results being off by two lines during a rebase or in the
divergence from upstream view.
2025-07-12 17:36:26 +02:00
Stefan Haller 2b41a27d92 Fix search results being off by two lines during rebase or in divergence view
We forgot to convert the model indices to view indices in searchModelCommits.
This needs to be done for search results to be highlighted correctly in the
"divergence from upstream" view, which adds "--- Remote/Local ---" entries, and
during a rebase, where we have "--- Pending rebase todos ---" and "--- Commits
---" which offset view indices from model indices.
2025-07-12 17:30:36 +02:00
Stefan Haller dd47ef7354 Make prepareConversionArrays a little more concurrency safe
I have seen cases where during a rebase (two nonModelItems) all entries in
viewIndicesByModelIndex beyond the second nonModelItem were off by 4 rather than
2 as I would expect. The only explanation I have for this is that the function
was called concurrently.

Improve this by working on a local variable and only assign to self at the end;
this is not a real fix for the concurrency issue of course, but it makes it much
less likely to be a problem in practice.
2025-07-12 17:25:35 +02:00
Stefan HallerandGitHub 228d4428ca Improve mouse handling of suggestions panel (#4726)
- **PR Description**

In prompts with a suggestions panel (e.g. the "Execute shell command"
window, or the "Filter by path" panel), you can now
- scroll the list of suggestions with the mouse wheel even when the
  focus is in the edit field
- click in the suggestions list or in the edit field to switch focus
  between them
- double-click a suggestion to trigger it
2025-07-11 11:26:39 +02:00
Stefan Haller 9baf787059 Allow double-clicking suggestions 2025-07-11 11:18:28 +02:00
Stefan Haller 3ff4552960 Allow switching between confirmation and suggestions by clicking
This is very similar to what we are doing to allow switching between commit
subject and description in the commit message editor.
2025-07-11 11:18:28 +02:00
Stefan Haller 21dd901bd9 Extract helper function 2025-07-11 11:18:28 +02:00
Stefan Haller 8ad2637715 Allow scrolling background views with the mouse wheel when a popup is showing
I see little reason to suppress this; the check was really only for click
events, not wheel events.
2025-07-11 11:18:28 +02:00
Stefan Haller f6c20f2745 Cleanup: use FocusedView property for mouse bindings
This way the click is only handled if a given view has the focus, and we don't
have to check this manually in the handler.
2025-07-11 11:18:28 +02:00
Stefan Haller 2e5cf46716 Make conditions easier to understand
This doesn't change behavior, just makes the code a little bit easier to
understand: the outermost condition is "do we show a popup and is the mouse
event for some other view than the focused one". Only if that's true do we need
to define the isCommitMessageView function, and check whether both views belong
to the commit message editor.
2025-07-11 11:18:28 +02:00
Stefan Haller 4a6041f3ce Exclude "." from file path suggestions
It looks funny and doesn't have any value.
2025-07-11 11:18:28 +02:00
Stefan Haller fee5794c83 Remove outdated comment
Maybe I'm misunderstanding what the comment was supposed to mean, but we do show
all paths if nothing has been typed.
2025-07-11 11:18:28 +02:00
Stefan HallerandGitHub 43b379fb09 Detect double-clicks properly (#4725)
- **PR Description**

Previously, any click on an already selected line in a list view was
treated as a double click, and triggered the same action as pressing
either enter or space, depending on the view. Improve this by doing
proper double-click detection based on how much time has passed between
clicks.

Fixes #2526.
2025-07-11 11:18:03 +02:00
Stefan Haller 37197b8e9a Add proper double-click handling for list views
Previously a click was detected as a double-click whenever the click was on the
already selected line, regardless of how long ago the last click was (or even
when it wasn't selected by clicking at all). Now that gocui supports proper
double-click detection, we can do better.
2025-07-11 10:52:57 +02:00
Stefan Haller 12df9d2b42 Assert that only one controller can set click or render functions on a BaseContext
The rationale for this is the same as in the previous commit; however, for these
functions we only allow a single controller to set them, because they are event
handlers and it doesn't make sense for multiple controllers to handle them.
2025-07-11 10:52:57 +02:00
Stefan Haller 4dfa4e8aa2 Allow more than one controller to attach OnFocus/OnFocusLost functions
Trying to do this would previously have the second one silently overwrite the
first one's.

We don't currently have this in lazygit, but I ran into the situation once
during development, and it can lead to bugs that are hard to diagnose.

Instead of holding a list of functions, we could also have added a panic in case
the function was set already; this would have been good enough for the current
state, and enough to catch mistakes early in the future. However, I decided to
allow multiple controllers to attach these functions, because I can't see a
reason not to.
2025-07-11 10:51:44 +02:00
Stefan Haller 9c5c459faa Cleanup: use nil for empty slice 2025-07-11 10:47:07 +02:00
Stefan Haller b3ca944c9e Remove GetOnRenderToMain, GetOnFocus, and GetOnFocusLost from BaseContext
These are never called on the context, they only exist to satisfy the
HasKeybindings interface. But that's wrong, HasKeybindings has nothing to do
with focus handling or rendering the main view. Remove them from that interface
and add them to IController instead.
2025-07-11 10:47:07 +02:00
Stefan Haller 0245d663c0 Bump gocui 2025-07-11 10:26:09 +02:00
Stefan HallerandGitHub c2aab81f54 Fix more unstable tests (#4721)
Similar to what was done in 457cdce61d, and for the same reason.
2025-07-10 09:02:41 +02:00
Stefan Haller bf19475733 Fix more unstable tests
Similar to what was done in 457cdce61d, and for the same reason.

However, instead of waiting and fixing them one by one as we see them fail, I
decided to go about it more systematically. To do that, I added calls to
`time.Sleep(1 * time.Second)` in all the Shell.Commit* helper functions; this
ensures that all the commits we make get different committer time stamps, making
all these tests fail. With this I'm pretty confident that we're good now.
2025-07-10 08:59:01 +02:00
Stefan HallerandGitHub 656cb3203c Fix stale main view content when entering/exiting filtering view (#4719)
- **PR Description**

When filtering by path, the main view wouldn't update the diff properly
when entering and exiting the filtering mode.
2025-07-09 16:03:54 +02:00
Stefan Haller 4981419ba9 Fix stale main view content when entering/exiting filtering view
When entering filtering we would only call FocusLine, which takes care of
highlighting the selected line in the commits list, but not of re-rendering the
main view. HandleFocus does that.

When exiting filtering, the HandleFocus call was missing entirely.

The tests needed to be reworked a little bit to make this testable.
2025-07-09 16:00:46 +02:00
Stefan Haller 457cdce61d Fix unstable tests
Now that -committerdate is the default sort order, we could get different
results for the sort order of the branches list depending on whether the commits
on both branches have the same committer time stamp (likely in an integration
test, since git time stamps have second resolution), in which case git will fall
back to alphabetical order, or not (rare, but possible), in which case master
will have the newer commit and will come first. Make this stable by forcing the
sort order to alphabetical.

We might have more tests with this problem, we'll just have to fix them one by
one as we see them fail.
2025-07-09 16:00:46 +02:00
Stefan HallerandGitHub 8026fc2bb9 Provide user config defaults for UI-changeable settings (#4717)
As discussed in #4602, we make a general change to how we treat UI
settings that can be changed from within lazygit; previously, the rule
was to persist them in State.yml so that they automatically remember the
last value that was set in the UI; now, we no longer do this, and
instead provide user configs for setting defaults which we fall back to
on every start.

See #4602 for an in-depth discussion about the pros and cons of either
approach, and why we chose this one.

As part of this, we change the default for the sort order of branches to
date (aka committerdate), both for local and for remote branches (was
recency and alphabetical before, respectively). See the discussion
starting
[here](https://github.com/jesseduffield/lazygit/pull/2147#issuecomment-1656700988)
for some reasons.

Fixes #4602.
2025-07-09 13:20:28 +02:00
Stefan Haller df48667253 Add a prompt for the sort order menus for branches 2025-07-09 13:16:42 +02:00
Stefan Haller 6bfcb3d6f0 Add tooltips for commit log menu 2025-07-09 13:16:42 +02:00
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 HallerandGitHub 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 HallerandGitHub 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 HallerandGitHub 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 HallerandGitHub 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 HallerandGitHub 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 HallerandGitHub 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 HallerandGitHub 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 HallerandGitHub 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 HallerandGitHub 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
Stefan HallerandGitHub b134763348 Try using PAT on sponsors CI (#4697) 2025-07-06 11:34:11 +02:00
Stefan HallerandGitHub 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
Stefan Haller 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
Stefan HallerandGitHub 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
Stefan Haller 48c3f347ce Move if to job level so that the entire thing doesn't run in forks 2025-07-06 10:51:46 +02:00
Stefan HallerandGitHub 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
Stefan HallerandGitHub 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.
2025-07-04 19:46:36 +02:00