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

434 Commits

Author SHA1 Message Date
3575bb9859 Add enum validation for Git.Log.Order and Git.Log.ShowGraph 2025-07-09 13:15:03 +02:00
562a2aaa6b Un-deprecate UserConfig.Git.Log.Order and ShowGraph
And remove them from AppState.
2025-07-09 13:15:03 +02:00
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
d79283656d Add missing validation tests 2025-07-09 13:15:03 +02:00
f318e45e9d Move DiffContextSize and RenameSimilarityThreshold to user config 2025-07-09 13:15:03 +02:00
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
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
2961c991a4 Add user config to use hunk mode by default when entering staging view 2025-07-04 19:41:40 +02:00
7aa426fa71 Enable errorlint linter, and fix warnings 2025-06-30 18:30:11 +02:00
0471dbaa84 Enable intrange linter, and fix warnings 2025-06-30 18:30:11 +02:00
80bbdf41fb add bold style for border 2025-06-15 16:28:20 +02:00
708b30ab8a Add option to disable warning when amending last commit 2025-06-13 16:34:05 +02:00
d60fe437ef Replace literal with ConfigFilename constant
Signed-off-by: Mateusz Łoskot <mateusz@loskot.net>
2025-05-31 02:28:39 +02:00
3cff48437e Add user config gui.addRootItemInFileTree 2025-05-24 18:17:25 +02:00
cabcd54508 Include migration changes in the error message if we can't log them
This is for the unlikely case that a repo-local config file can't be written
back after migration; in this case we can't log the migration changes to the
console, so include them in the error popup instead.
2025-05-21 08:51:24 +02:00
a4f43cb275 Log a list of migration changes to the console
This might be useful to see in general (users will normally only see it after
they quit lazygit again, but still). But it is especially useful when writing
back the config file fails for some reason, because users can then make these
changes manually if they want.

We do this only at startup, when the GUI hasn't started yet. This is probably
good enough, because it is much less likely that writing back a migrated
repo-local config fails because it is not writeable.
2025-05-21 08:51:24 +02:00
caa8c921e6 Make RenameYamlKey return a bool 2025-05-21 08:51:24 +02:00
ffda51014d Print migration hints only when GUI hasn't started yet
Most migrations happen at startup when loading the global config file, at a time
where the GUI hasn't been initialized yet. We can safely print to the console at
that point. However, it is also possible that repo-local config files need to be
migrated, and this happens when the GUI has already started, at which point we
had better not print anything to stdout; this totally messes up the UI.

In this commit we simply suppress the logging when the GUI is running already.
This is probably good enough, because the logging is mostly useful in the case
that writing back the migrated config file fails, so that users understand
better why lazygit doesn't start up; and this is very unlikely to happen for
repo-local config files, because why would users make them read-only.
2025-05-21 08:51:24 +02:00
61822b73f0 Add tests for migrating null keybindings to <disabled> 2025-05-21 08:51:24 +02:00
df805f3a1a Add tests for migration of renamed keys 2025-05-21 08:51:24 +02:00
0249d4c8ab Cleanup: return didChange bool from computeMigratedConfig
It's a bit silly to find out by string comparison whether computeMigratedConfig
did something, when it knows this already and can just return the information.

This doesn't make a huge difference to the production code; the string
comparison isn't very expensive, so this isn't a big deal. However, it makes the
tests clearer; we don't have to bother specifying an expected output string if
the didChange flag is false, and in particular we can get rid of the ugly "This
test intentionally uses non-standard indentation" bit in one of the tests.
2025-05-21 08:51:24 +02:00
4f959da9f8 Cleanup: fix formatting of test cases 2025-05-21 08:51:24 +02:00
da5789ba5f Cleanup: flip conditions for less indentation 2025-05-21 08:51:24 +02:00
bf13e0bc6a Cleanup: use assert.NoError 2025-05-21 08:51:24 +02:00
450239d5c8 Add an alternate keybinding (default <c-s>) for ConfirmInEditor
The default binding for ConfirmInEditor is <a-enter>, which has two problems:
- some terminal emulators don't support it, including the default terminal on
  Mac (Terminal.app)
- on Windows it is bound to toggling full-screen

Ideally we would use <c-enter> instead (and Command-Enter on Mac), but neither
is possible without https://github.com/gdamore/tcell/issues/671, so for the time
being add an alternate keybinding which works everywhere.

Show both bindings in the footer of the commit description panel if they are
both non-null. While we're at it, fix the footer for the case where either or
both of the keybindings are set to <disabled>.

And finally, change "commit" to "submit" in that footer; we use the same panel
also for creating tags, in which case "commit" is not quite right.
2025-05-11 13:59:22 +02:00
4e497eef8a reword documentation for git.autoForwardBranches 2025-05-08 16:37:26 -04:00
1028f8efb8 Migrate deprecated AllBranchesLogCmd to AllBranchesLogCmds
This solves https://github.com/jesseduffield/lazygit/issues/3961 because
we no longer have a combination of the default and the user defined
list. We just have the user defined list.
2025-05-06 23:33:17 -04:00
a9f9dee30d Combine customCommand's subprocess, stream, and showOutput fields into a single output enum 2025-05-01 15:46:06 +02:00
4e3d09e9d8 Validate custom commands in sub menus 2025-05-01 15:21:27 +02:00
e295477951 Add test demonstrating missing validation for custom commands in sub menus
We only validate the commands at top level right now.
2025-04-30 17:41:49 +02:00
7137196788 Add comments in tests to explain what they test
Looking at these again, I needed a moment to remember what they do, so make this
more obvious to help future readers.
2025-04-30 17:31:58 +02:00
4cfa6e0c98 Modernize benchmarks
See https://go.dev/blog/testing-b-loop
2025-04-29 14:57:15 +02:00
4d0eaea6fc Fix nvim-remote commands for fish shell
Fish shell does not support "&&" and "||" operators like
POSIX-compatible shells. Instead, it uses a different syntax structure
based on begin/end and if/else.

This caused existing lazygit nvim-remote integration templates to break
when fish was the user's default shell.

This commit adds explicit fish shell detection using the FISH_VERSION
environment variable, and provides fish-compatible templates that
correctly handle launching Neovim or sending remote commands via $NVIM.

Fixes behavior where edits would not open in a new Neovim tab or line
navigation would fail when $NVIM was set.

Ensures smoother editing experience for users running fish shell
(supported since Nov 2012 with FISH_VERSION).
2025-04-27 20:12:11 +02:00
30868eead8 Add new command "Move commits to new branch" 2025-04-21 18:12:50 +02:00
eaaa937315 Add config for auto-forwarding branches after fetching 2025-04-21 18:06:09 +02:00
1a93b2324b Allow focussing the main view
In this commit this is only possible by pressing '0' in a side panel; we'll add
mouse clicking later in the branch.

Also, you can't really do anything in the focused view except press escape to
leave it again. We'll add some more functionality in a following commit.
2025-04-21 18:03:19 +02:00
80b5e21bd5 Add a command to select all commits of the current branch
This is useful for seeing the combined diff of all commits of a branch.
2025-04-10 09:02:09 +02:00
dc48cf963a Add config os.shellFunctionsFile 2025-04-07 14:35:40 +02:00
41e9335ea8 Reorder configs in OSConfig
There is a section at the end with deprecated settings, and a comment saying
"The following configs are all deprecated". The clipboard-related settings were
accidentally added to that section; they are not deprecated, so move them up to
before that section.
2025-04-07 14:35:40 +02:00
8ec37f80b7 Let users to define custom icons and color for files on the config file
Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
2025-03-25 09:48:12 +01:00
a64c32d431 Add in missing "deprecated" yaml tags 2025-03-23 12:45:34 +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
95c5d51e64 Support home and end as alternatives to '<' and '>' 2025-03-17 19:58:01 +01:00
f989425f8c Add acme editor preset 2025-03-06 15:02:53 +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
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