1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00
Commit Graph

4226 Commits

Author SHA1 Message Date
c765da10f5 Allow passing refresh scope to WithGpgHandling 2025-03-24 08:41:58 +01:00
c06d4e7b18 fix: Make tag operation use GPG helper to run signing in sub-process 2025-03-24 08:41:58 +01:00
f779a5878d refactor: Express WithGpgHelper with a config key parameter 2025-03-24 08:41:58 +01:00
6fb3b7430c refactor: Make commit.gpgSign match official capitalization
The actual usage is case insensitive, so this doesn't actually matter.
But if fills my heart with joy.

The test is case sensitive, but the actual response to `git config
commit.gpgSign` is equivalent to `git config commit.gppsign`
2025-03-24 08:41:58 +01:00
52da806c57 refactor: Rename UsingGpg to make room for Gpg Tag logic 2025-03-24 08:41:58 +01:00
a64c32d431 Add in missing "deprecated" yaml tags 2025-03-23 12:45:34 +01:00
b5d4bdbd08 Remove deprecated configs from auto generated config.md 2025-03-23 12:44:24 +01:00
c3b099398b Include empty arrays and maps in the generated Config.md
It's not an ideal solution because there's no indication of what kind of objects
you can add to those maps or arrays, but at least they show up at all (with a
comment containing a link to more information), and that's already an
improvement.
2025-03-22 12:35:24 +01:00
0c9154ca9d Add comments with more information
This will be useful in the next commit when these start to show up in the
generated Config.md.
2025-03-22 12:35:24 +01:00
728f0d9dfa Remove text that is now unused 2025-03-22 11:06:15 +01:00
b102646b20 Commit without pre-commit hooks is independent on prefix
Add verify flag

Add and update integration tests

Rename verify to forceSkipHooks

Adapt CommitSkipHooks integration test to actually use a hook

Remove forceSkipHooks param from OnConfirm et al

Simplify tests
2025-03-22 11:04:28 +01:00
5de735f1ac feat(submodules): add method to bulk init and update submodules 2025-03-22 09:54:32 +01:00
26459523f5 Add a root item ("/") if files at top level have changed 2025-03-21 08:04:58 +01:00
0b42cfb568 Make Node.path private
This is in preparation for changing the meaning of path in the next commit.
2025-03-20 12:31:34 +01:00
3f4cb8bdda Use Path directly instead of GetPath getter inside the filetree package 2025-03-20 12:31:34 +01:00
53090b2c45 Use GetPath accessor outside of filetree package
In preparation of making it private to the package.
2025-03-20 12:31:34 +01:00
2dfc3491bd Rename Name to Path in File and CommitFile
Name was very confusing and misleading.
2025-03-20 12:31:34 +01:00
0b5504aa98 Cleanup: make integration test assertions for files panel more specific
Assert the entire lines using Equals instead of Contains. This makes the tests a
bit easier to read, and it makes it much easier to decide how they need to be
changed when we change the layout (like we do in the last commit of this
branch).

It is true that this requires changing all these tests for any future UI
changes, but I think this is a good price to pay; those adaptions are trivial
and can be done without thinking.
2025-03-20 11:58:50 +01:00
030c2e5aef Fix postFilterTest to actually do what it says
I'm pretty sure that the check for the main view was meant to be done with the
commit selected in the commits panel, not with the first file of the commit
files view selected, so it was pressing enter too early. It's pure coincidence
that the test worked.
2025-03-20 11:58:50 +01:00
f7295a97c0 Add a "Content of selected file" entry to the copy menu for commit files
This is useful for copying the entire content of the selected file as it was at
the selected commit.

We only add it to the commit files panel; it is not needed in the files panel,
because there you can simply press "e" to edit the file.
2025-03-20 11:52:53 +01:00
3e15be576e Drop the git config cache when getting focus
This allows changing git config values while lazygit is running (e.g. in a
different terminal tab, or even in lazygit's ":" shell prompt), and have them
take effect immediately, while still getting some benefit from caching them
while lazygit is in the foreground.
2025-03-20 11:50:28 +01:00
f98ad65f46 Cleanup: remove more unnecessary type arguments
Missed these in 44097384d3.
2025-03-20 11:50:28 +01:00
cf27399571 Revert "Skip post-checkout hook when discarding changes"
This reverts commit 964278255b.
2025-03-20 11:41:15 +01:00
95c5d51e64 Support home and end as alternatives to '<' and '>' 2025-03-17 19:58:01 +01:00
7a1b63182d Commit only tracked files in tracked only filter view 2025-03-17 19:51:27 +01:00
220f06052a Show staged but untracked files in tracked only filter view 2025-03-17 19:50:58 +01:00
95940ee01e Ignore commit prefixes with an empty pattern
Before we changed the commitPrefix config to a list in #4261, we had this bug
where the defaults section in Config.md would erroneously list the default for
commitPrefix as

  git:
    commitPrefix:
      pattern: ""
      replace: ""

This was not correct, commitPrefix was a pointer, and the default for that was
nil, which is not the same.

Now, some people copied and pasted the entire defaults section into their config
files, setting the commitPrefix to an empty pattern (which is not the same as
not setting it at all). And this caused the branch name to be filled in to the
subject field for every commit; see for example
https://github.com/jesseduffield/lazygit/discussions/3632.

New users copying the defaults section into their config file in the current
version no longer have this problem because now that commitPrefix is a list, it
is no longer included in the defaults section. However, the migration that we
added in #4261 would happily carry over those empty strings into a list entry,
so people migrating from an older version still have the broken config in their
config files.

To work around the issue, ignore commit prefix settings whose pattern is an
empty string. I can't imagine a valid reason why people would actually want to
set the pattern to an empty string, so I assume this only comes from the broken
defaults problem described above.
2025-03-12 08:15:36 +01:00
c1ca1c8f99 URL encode gitlab brackets to make consistent with branch names
Some operating systems 'open' implementations do not like
when some special characters are unencoded, so they will
double-enconde the branch name, which we already encode.

This particularly matters since branch names with / are common
2025-03-12 09:04:04 +11:00
b76b73943a Add an integration test for a config with a negative refspec 2025-03-11 08:33:41 +01:00
be7583dd40 Update to go 1.24 2025-03-08 14:53:54 -05:00
f989425f8c Add acme editor preset 2025-03-06 15:02:53 +01:00
20ab6c8cc8 Set tab titles after reloading user config
This ensures that tab titles are updated to the new language when changing the
language in the config while lazygit is running.
2025-03-06 08:24:03 +01:00
8c014641d1 Set view titles in configureViewProperties rather than createAllViews
This ensures that they are updated to the new language when changing the
language in the config while lazygit is running.
2025-03-06 08:24:03 +01:00
1213e875bb Cleanup: standardize on accessing translations via gui.c.Tr 2025-03-06 08:24:03 +01:00
b31607250d Fix layout of options view for non-english languages
The width calculations didn't take multi-byte characters into account.
2025-03-06 08:19:35 +01:00
e6d6ed4f9a Use Rewording instead of Committing when rewording the head commit
Now that we have this status, let's use it for the head case too, for
consistency.
2025-03-06 08:15:18 +01:00
c18d8af9f4 Use a WithWaitingStatus for rewording a non-head commit
Rewording a commit at the beginning of a long branch can take very long;
without this change, the commit message panel would stay visible with a blinking
cursor during that time, which is very confusing.

This has the slight downside that it will say "Rebasing" in the lower right
corner until the operation is done; but we already have this problem when doing
custom patch operations, or dropping changes from a commit, so it's not new, and
we can think about how to fix all these another time.
2025-03-06 08:15:18 +01:00
eda65cbade Avoid double Refresh when rewording the head commit
WithGpgHandling already does an async refresh when done, so there's no need to
do one here for the case of amending the head commit. On top of that,
WithGpgHandling uses WithWaitingStatus and works in the background, so the
Refresh here would come too early anyway.
2025-03-06 08:15:18 +01:00
41a7afb105 Don't call OnCommitSuccess in handleReword
All this does is clear the preserved commit message; however, we open the commit
message panel with PreserveMessage: false when rewording, so this is not
necessary.
2025-03-06 08:15:18 +01:00
f28b6f439d Support fish when running shell command
This should allow using custom shell functions in lazygit's : prompt.
2025-03-06 08:11:32 +01:00
44097384d3 Remove unnecessary type arguments
I'm getting warnings in my editor about these, probably because of an updated
gopls again.
2025-03-03 21:24:49 +01:00
a4d6d020c4 Remove unused functions
For some reason the //nolint:golint,unused comment no longer seems to work after
I updated gopls (I think).

But I also don't understand why we mark unused stuff with linter comments
instead of just getting rid of it.
2025-03-03 21:23:29 +01:00
df17896de5 Validate properties of customCommand when commandMenu is used 2025-02-28 10:11:30 +01:00
22512d55a8 Add commandMenu property to custom commands 2025-02-28 10:11:30 +01:00
e799976b8a Extract a method CustomCommand.GetDescription
We'll reuse it in the next commit.
2025-02-28 10:00:59 +01:00
f93948cb23 Change customCommand fields to pointers
This allows us to tell whether they appear in the user's config file, which we
will need later in this branch.
2025-02-28 10:00:59 +01:00
0df5e08828 Don't set showOutput explicitly
It is false by default. This way there's one less change to make in the next
commit.
2025-02-28 10:00:59 +01:00
9ad50028f8 Fix wrong comment
This was backwards; we renamed Sha to Hash, so Sha is now deprecated, not Hash.
2025-02-28 10:00:59 +01:00
d39f883b4e Migrate to only doing marshalling twice, and compare via deep copy 2025-02-27 17:05:31 -05:00
a01ca19bb3 Set up benchmark on migration 2025-02-27 12:38:21 -05:00