1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-19 17:02:18 +03:00

2600 Commits

Author SHA1 Message Date
Stefan Haller
825e5c23c1 Fix crash when dragging from below the end of the diff upwards and then staging the range
We need to clamp the range start index of a selection range in the same way as
we clamp the selection index.
2025-04-11 10:14:46 +02:00
Stefan Haller
a3ae1c8e4d Refactor: extract function clampLineIdx
And reimplement using lo.Clamp instead of comparing manually.
2025-04-11 10:14:46 +02:00
Peter Cardenas
93899b82fa fix: update vscode color to logo color 2025-04-10 09:56:19 +02:00
Stefan Haller
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
Stefan Haller
b3bffbec4a Show "hooks disabled" in title bar of commit message editor
It is shown either when committing with `w`, or when typing the skipHooks prefix
if there is one. This should hopefully make it clearer when the hooks are run
and when they are not.
2025-04-10 08:57:32 +02:00
Stefan Haller
2ee80d7150 Cleanup: don't render the commit length when typing in the description
Only the commit message has an effect on this value, the description doesn't.
2025-04-10 08:55:13 +02:00
Stefan Haller
ced70903ec Prefill the commit subject with the skipHook prefix when pressing w
We removed prefilling the skipHook prefix in b102646b207 with the intention of
making it clearer that using the prefix in normal commits and typing `w` to skip
hooks are now two independent features.

It turns out that some people liked it with prefilling the prefix and perceive
it as a regression, so put it back in.

But only if we don't have a preserved message; this is an important use case,
when you try to make a normal commit, the hook fails, and then you want to make
the same commit with skipping the hook, but with the same message that you
already typed.
2025-04-10 08:53:11 +02:00
Ruud Kamphuis
12820481e6 Add runCommand function to Go template syntax
This makes it possible to use date and time in initial values like this:

```yaml
initialValue: 'ruudk/{{ runCommand "date +\"%Y/%-m\"" }}/'
```

I want to use this to configure my BranchPrefix like this:

```yaml
git:
  branchPrefix: 'ruudk/{{ runCommand "date +\"%Y/%-m\"" }}/'
```
2025-04-09 10:44:36 +02:00
Stefan Haller
ebb576feac Provide conflict resolution dialogs for non-textual conflicts 2025-04-09 10:27:57 +02:00
Stefan Haller
2e1be45957 Better main view display for conflicing files
For the less common conflict types DD, AU, UA, DU, and UD, we would previously
only show "* Unmerged path" in the main view, which isn't helpful. Also, for
some of these we would split the main view and show this text both in the
unstaged changes and staged changes views, which is a bit embarrassing.

Improve this by offering more explanation about what's going on, and what the
most likely way to resolve the situation is for each case.
2025-04-09 10:27:57 +02:00
Stefan Haller
b09251e27b
Merge branch 'master' into fix-display-of-renamed-files-in-tree-view 2025-04-08 16:17:33 +02:00
Stefan Haller
59af407eb1 Fix the bug described in the previous commit 2025-04-08 16:14:31 +02:00
Stefan Haller
8a4506066a Add pageUp/pageDown/top/bottom keybindings to focused command log panel 2025-04-08 16:11:15 +02:00
Stefan Haller
2b783d1bc6 Add pageUp/pageDown/top/bottom keybindings to confirmation panel 2025-04-08 16:11:15 +02:00
Stefan Haller
8ba57b6bd0 Cleanup: remove unused interfaces for helpers
I can only guess here: maybe they were added to more clearly document the public
interface of the classes? If so, I don't think that works. Developers who are
not familiar with the convention will just add a new public method to the class
without updating the interface.
2025-04-08 16:08:25 +02:00
Stefan Haller
b3215a750c Cleanup: get rid of the variadic parameter of ContextMgr.Push
Apparently this was an attempt at working around go's lack of default arguments,
but it's very unidiomatic and a bit confusing. Make it a normal parameter
instead, so all clients have to pass it explicitly.
2025-04-08 16:08:25 +02:00
Stefan Haller
6f31f94266 Enable AutoRenderHyperLinks for the tooltip view
Sometimes tooltips contain documentation links, it's useful to be able to
single-click them.
2025-04-08 16:05:34 +02:00
Stefan Haller
dc48cf963a Add config os.shellFunctionsFile 2025-04-07 14:35:40 +02:00
Stefan Haller
4e5e21f946 Revert commits related to using an interactive shell for running shell commands
This reverts commits f28b6f439d, dbd407c01d, 5fac40c129, and 5a3049485c.
2025-04-07 14:35:40 +02:00
Brandon
f75c0af6e0 Update disabled message 2025-04-07 09:42:19 +02:00
Brandon
1fa9ea7f04 Fix discarding submodule changes in nested folders
The current rules for discarding submodule changes is that no other changed item
must be also selected. There are some bugs with the current implementation when
submodules are in folders.

For example, selecting and discarding a folder with only a nested submodule
change will currently do nothing. The submodule changes should be discarded. The
folder only contains submodule changes so it should be no different than
pressing discard on the submodule entry itself.

Also, I noticed range selecting both the folder and the submodule and then
pressing discard would be incorrectly disallowed.
2025-04-07 09:42:19 +02:00
Brandon
106b7018dd Cleanup: rename predicate params (test -> predicate) 2025-04-07 09:39:42 +02:00
Stefan Haller
b0b8ef9cf6 Fix display of renamed files
This broke with #4346 (Add root node in file tree).
2025-04-02 18:15:44 +02:00
gaogao-qwq
3a03aebd89
feat: Implement range stash drop
Signed-off-by: gaogao-qwq <gaogaoqwq@gmail.com>
2025-04-02 17:34:35 +08:00
Stefan Haller
10f29bc6b4 Fix race with PTYs in integration tests
In 8b8343b8a9f we made a change to run newPtyTask from AfterLayout; this is
needed so that the PTY gets the new, updated view size. However, this created a
race condition for integration tests that select a line in a list view and then
expect the main view to have certain content; sometimes that content gets
rendered too late.

I'm surprised that this didn't cause more tests to fail; right now I only know
of one test that occasionally fails because of this, which is stash/rename.go.

Fix this by moving the AfterLayout to inside newPtyTask, and do it only when we
are actually using a PTY (we don't when no pager is configured, which is the
case for integration tests).

The diff is best viewed with "ignore whitespace" turned on.
2025-03-28 11:16:04 +01:00
Stefan Haller
d2d13449e4 Cleanup: remove pointless if statement 2025-03-28 11:06:35 +01:00
Stefan Haller
a8f6b04ff3 Add "Absolute path" item to the file view's copy menu
Rename the existing item to "Relative path".
2025-03-25 10:00:56 +01:00
Stefan Haller
d2059df543 Fix the bug mentioned in the previous commit 2025-03-25 09:56:01 +01:00
hasecilu
0f37f62770 Fix double '#' on hexadecimal colors 2025-03-25 09:48:12 +01:00
hasecilu
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
Stefan Haller
c765da10f5 Allow passing refresh scope to WithGpgHandling 2025-03-24 08:41:58 +01:00
Chris McDonnell
c06d4e7b18 fix: Make tag operation use GPG helper to run signing in sub-process 2025-03-24 08:41:58 +01:00
Chris McDonnell
f779a5878d refactor: Express WithGpgHelper with a config key parameter 2025-03-24 08:41:58 +01:00
Chris McDonnell
52da806c57 refactor: Rename UsingGpg to make room for Gpg Tag logic 2025-03-24 08:41:58 +01:00
Korbinian Schweiger
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
Cesar Andres
5de735f1ac feat(submodules): add method to bulk init and update submodules 2025-03-22 09:54:32 +01:00
Stefan Haller
26459523f5 Add a root item ("/") if files at top level have changed 2025-03-21 08:04:58 +01:00
Stefan Haller
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
Stefan Haller
3f4cb8bdda Use Path directly instead of GetPath getter inside the filetree package 2025-03-20 12:31:34 +01:00
Stefan Haller
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
Stefan Haller
2dfc3491bd Rename Name to Path in File and CommitFile
Name was very confusing and misleading.
2025-03-20 12:31:34 +01:00
Stefan Haller
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
Stefan Haller
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
Stefan Haller
f98ad65f46 Cleanup: remove more unnecessary type arguments
Missed these in 44097384d30d.
2025-03-20 11:50:28 +01:00
Stefan Haller
95c5d51e64 Support home and end as alternatives to '<' and '>' 2025-03-17 19:58:01 +01:00
Partho Kunda
7a1b63182d Commit only tracked files in tracked only filter view 2025-03-17 19:51:27 +01:00
Partho Kunda
220f06052a Show staged but untracked files in tracked only filter view 2025-03-17 19:50:58 +01:00
Stefan Haller
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
Kevin Radloff
be7583dd40 Update to go 1.24 2025-03-08 14:53:54 -05:00
Stefan Haller
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