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

4072 Commits

Author SHA1 Message Date
Stefan Haller
b0ab6529c1 Escape special characters when git-ignoring files 2025-04-13 18:25:24 +10:00
Stefan Haller
41f89d86f0 Add test that shows problems with git-ignoring files with special characters
For #, !, [, and ], the problem is that it doesn't ignore the file because the
special characters need to be quoted. For *, the problem is that it ignores too
much (it also hides the abc_def file because the * is treated as a glob).
2025-04-13 18:25:24 +10:00
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
Stefan Haller
204f6c7edb Update translation files from crowdin 2025-04-10 11:40:55 +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
Stefan Haller
b78aa54439 Use dario.cat/mergo instead of github.com/imdario/mergo
It's the new canonical location as of 1.0.0, the old one is deprecated and stuck
on 0.3.something.
2025-04-09 11:23:55 +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
Ruud Kamphuis
c7feba9bb1 Move test from commit to branch 2025-04-09 10:44:36 +02:00
Stefan Haller
82e1caa166 Remove conditional code related to git earlier than 2.22 2025-04-09 10:40:52 +02:00
Stefan Haller
765168b9d7 Remove canUsePushTrack parameter of obtainBranches function
It was only needed for git versions older than 2.22.
2025-04-09 10:40:52 +02:00
Stefan Haller
ad813503fb Bump minimum required git version to 2.22
Versions older than 2.22 have issues with "git cherry-pick --continue" and
"git cherry-pick --skip" that are difficult to work around.
2025-04-09 10:40:52 +02:00
Stefan Haller
ebb576feac Provide conflict resolution dialogs for non-textual conflicts 2025-04-09 10:27:57 +02:00
Stefan Haller
efcd71b296 Allow chaining of FileSystem methods 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
f20b7ea593 Add test demonstrating problem with main view display when pressing e in a stack of branches
We keep the same commit selected (even though its index changed because of the
added update-ref todo), which is nice; however, the main view shows the diff of
the wrong commit, which is very confusing. I'm suprised that this hasn't been
noticed yet.

The reason why this happens is that we first do the refresh, which includes
re-rendering the main view diff (with the same commit index as before, so the
wrong one), and then we restore the correct commit index but don't render the
main view again.
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
d13306ac64 Add a breaking changes entry for using shell aliases 2025-04-07 14:35:40 +02:00
Stefan Haller
dc48cf963a Add config os.shellFunctionsFile 2025-04-07 14:35:40 +02:00
Stefan Haller
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
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
2db0a024bc Add integration test 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
Stefan Haller
267ef70de6 Add test showing problem with the display of renamed files
Renaming a file inside the same directory shows it with its full path in the
tree view, which isn't what we want. We'll fix this in the next commit.

Also adding a few other test cases for moving files; they show that the display
of moved files in tree view isn't ideal. For example, moving file1 from top
level into dir shows it as "R file1 → file1", which isn't distinguishable from
renaming file1 inside dir. I suppose what we would like to have here is
"R ../file1 → file1" or something, but I'll leave that for the future; here I
only want to fix the regression that was introduced with the root item PR.
2025-04-02 18:15:27 +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
Stefan Haller
61c56c7822 Add test for checking out a file from a range selection of commits
The test shows a misbehavior: even though the diff shows "-one" and "+three",
meaning that "three" is the state we want to check out, we get "one". The reason
is that the checkout file command doesn't pay attention to range selections, it
only looks at the "moving end" of the range. Had we created the range by
selecting "two" and then pressed shift-up to "three", we would have gotten the
expected result.
2025-03-25 09:56:01 +01:00
Stefan Haller
ac7d8ad025 Add test for checking out a file from a commit
This works, we just didn't have a test for it.
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
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