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

5640 Commits

Author SHA1 Message Date
7ed94c0410 Replace CurrentContext() with Context().Current() 2024-08-17 11:14:51 +02:00
8e15451117 Remove unused method RemoveContexts() 2024-08-17 11:14:51 +02:00
111d10fe5c Replace ReplaceContext() with Context().Replace() 2024-08-17 11:14:50 +02:00
98335361fd Replace PopContext() with Context().Pop() 2024-08-17 11:14:50 +02:00
bd36b8a95e Replace PushContext() with Context().Push() 2024-08-17 11:14:50 +02:00
d89dc967b8 Rename "Custom Command" to "Shell Command" (#3800)
- **PR Description**

The double use of the term "Custom Command" for both shell commands and
user-configured keybindings was confusing.
2024-08-17 10:59:23 +02:00
dbca9306de Rename "Custom Command" to "Shell Command"
The double use of the term "Custom Command" for both shell commands and
user-configured keybindings was confusing.
2024-08-17 10:56:03 +02:00
0cbe08b105 Add new integration tests folder "shell_commands"
The folder custom_commands contained tests for both custom commands (the ones
you configure in config.yml) and shell commands (the ones you execute at the ":"
prompt). I always found this confusing, so separate these into two different
folders.
2024-08-17 10:56:03 +02:00
af5b19a9da Fix line coloring when using the delta pager (#3820)
- **PR Description**

The green/red bars for added/deleted lines in delta wouldn't extend to
the right edge of the view, but end after the last printable character.
This was broken before, and fixed in #1386 two years ago, but then it
broke again in v0.42 because of #3687.
2024-08-17 10:53:47 +02:00
da8e4e44b7 Bump gocui 2024-08-17 10:50:32 +02:00
69666d1089 Switch tabs with panel jump keys (#3794)
- **PR Description**

When using the panel jump keybindings (`1` through `5` by default), and
the target panel is already the active one, go to the next tab instead.
2024-08-17 10:39:57 +02:00
b37d6dcd1c When using the panel jump keys and the target panel is already active, switch tabs 2024-08-17 10:37:00 +02:00
c72be6cbf3 Allow using shell aliases in interactive custom commands (#3793)
- **PR Description**

When executing an interactive custom command, use the user's shell
rather than "bash", and pass the -i flag. This makes it possible to use
shell aliases or shell functions which are not available in
non-interactive shells.

In previous attempts to solve this, concerns were brought up: [this
one](https://github.com/jesseduffield/lazygit/pull/2096#issuecomment-1257072541)
is addressed by using the interactive shell only for custom commands but
not anything else. [This
one](https://github.com/jesseduffield/lazygit/pull/2096#issuecomment-1343341795)
is a little dubious and unconfirmed, so I'm not very worried about it.

Supersedes #2096 and #3299. Fixes #770, #899, and #1642.
2024-08-17 10:34:40 +02:00
5a3049485c Use an interactive shell for running custom commands
Also, use the user's shell (from the SHELL env variable) instead of bash. Both
of these together allow users to use their shell aliases or shell functions in
the interactive command prompt.
2024-08-17 10:32:18 +02:00
39e77d1823 Extract helper function quotedCommandString
Will be reused in the next commit.
2024-08-17 10:32:18 +02:00
da94ee7a9a Fix redraw bug (stale content) in commits view (#3783)
- **PR Description**

When switching from a branch with fewer commits than fit in the commits
panel to another branch with even fewer commits, the last few commits of
the old branch were still drawn at the bottom.

Fixes #3778.
2024-08-17 10:29:39 +02:00
62ca873ddd Bump gocui 2024-08-17 10:25:16 +02:00
9404c2309c Allow GPG reword for last commit (#3815)
- **PR Description**
This PR fixes #3806, which is only for the last commit.
Would be good if this could be extended to commits older than head.
2024-08-16 13:11:17 +02:00
4a2508e960 Allow rewording for last commit using GPG 2024-08-16 13:08:31 +02:00
ce6388bdfa Adding guard to not do reword under git_commands when using gpg 2024-08-15 08:54:23 +02:00
58d7467180 Fix lack of icon assignation when extension don't match capitalization (lowercase) (#3810)
- **PR Description**
The extension icon map contain all extensions on lowercase, when a file
don't have extension on lowercase the string don't match and icon is not
assigned.
2024-08-09 12:19:46 +02:00
cb53e377a8 Fix lack of icon assignation when extension don't match capitalization 2024-08-08 15:18:02 -06:00
a3560eb451 Don't exit app when GetRepoPaths call fails during startup (#3779)
- **PR Description**
Fixes #3740 

As explained in the issue, 7a67096 moved some code around that caused a
call to `GetRepoPaths` to occur before `setupApp`, which usually handles
the scenario where we are not in a git directory. `GetRepoPaths` returns
an error if the path isn't a git repository, which caused the app to
exit before we reached `setupApp`.

When starting up lazygit, we ignore (and log) the error returned by
`GetRepoPaths`, and continue instead of exiting early. This allows us to
reach the step where we follow the user's `notARepository` config entry.
2024-08-03 18:37:53 +02:00
ef4fd70f9c Ignore GetRepoPaths error when launching 2024-08-03 10:02:47 -04:00
74fe069da9 feat(custom command): support multiple contexts within one command (#3784)
- **PR Description**

For some custom commands, they can be used in multiple contexts. But for
now, if we want to do this, we should copy and paste the same config
times and times with just a different **context**.

Related issue: #3759 

This PR makes it possible to use multiple contexts in the `context` field of 
`customCommand`, separated by comma.
2024-08-02 11:59:39 +02:00
542030f190 Support multiple contexts within one command, add tests, update doc 2024-08-02 11:55:29 +02:00
206b2c6f0b Add a unit test case for global context 2024-08-02 11:55:29 +02:00
dc87592876 Add a readme file for the JSON files in pkg/i18n/translations (#3781) 2024-07-26 11:04:18 +02:00
37f35da436 Add a readme file for the JSON files in pkg/i18n/translations
People have started sending PRs that change these files.
2024-07-26 11:00:10 +02:00
f598da0df2 Reapply "Check for fixup commits on CI" (#3745)
Re-enable the check for fixup commits (see #3742), make it work for
forks, and extend it to "amend!" and "WIP" commits (and a few others).
2024-07-13 15:17:50 +02:00
20ccb03a45 Extend check for fixups
Also check for squash! and amend! (these are all anchored to the beginning of
the subject), and WIP and DROPME for good measure (but only if they occur in the
first line, otherwise it wouldn't let me merge this very commit :)
2024-07-13 15:15:01 +02:00
891362dfb2 Use extended regex rather than perl regex in the git call
My local git is not compiled with PCRE support, so using -E makes it easier for
me to test the script locally. And -E is good enough for the simple matching we
want to do here.
2024-07-13 15:02:34 +02:00
463cf35e64 Make checkout action work with forks 2024-07-13 14:39:28 +02:00
1919a2d2d6 Reapply "Check for fixup commits on CI"
This reverts commit f2db9fa3f9.
2024-07-13 14:08:44 +02:00
71ad3fac63 Fix language auto detection (#3744)
- **PR Description**

Fix a regression (introduced with #3649) that broke language
auto-detection. When starting lazygit with the `gui.language` config set
to "auto" (which is the default), lazygit would fail to start if the
LANG environment is set to one of our supported languages.

For example:
```
$ export LANG=nl_NL
$ lazygit
2024/07/13 11:43:03 open translations/nl-NL.json: file does not exist
```

Fixes #3743
v0.43.1
2024-07-13 12:14:39 +02:00
ae4a579153 Fix language auto-detection
Starting lazygit with an environment containing LANG=ko_KO or LANG=nl_NL would
result in an error at startup.
2024-07-13 12:07:59 +02:00
da86096e19 Add test that demonstrates bug with language auto-detection 2024-07-13 12:07:59 +02:00
e1d973d62a README.md: Update Sponsors (#3732)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
v0.43.0
2024-07-13 15:04:32 +10:00
0489b11c0c README.md: Update Sponsors 2024-07-13 05:03:33 +00:00
c7a9b9ca07 Add support for setting the similarity threshold for detecting renames (closes #2904) (#3025)
- **PR Description**
Implement the feature as discussed in #2904.

- **Please check if the PR fulfills these requirements**

* [x] Cheatsheets are up-to-date (run `go run scripts/cheatsheet/main.go
generate`)
* [x] Code has been formatted (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
* [x] Tests have been added/updated (see
[here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)
for the integration test guide)
* [x] Text is internationalised (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation))
* [x] Docs (specifically `docs/Config.md`) have been updated if
necessary
* [x] You've read through your own file changes for silly mistakes etc

---

_Edit: Previously I have left the "Text is internationalised" checkbox
empty, as I thought that it would also have to include translations, but
as I understand currently, that would be "localization" instead, so I
ticked it._

<!--
Be sure to name your PR with an imperative e.g. 'Add worktrees view'
see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for
examples
-->
2024-07-13 15:03:21 +10:00
f2db9fa3f9 Revert "Check for fixup commits on CI"
This reverts commit 7652d579f5.

Not working on forks, and I don't have time to fix right now
2024-07-13 14:54:20 +10:00
b9107d5fc8 Support setting the similarity threshold for detecting renames 2024-07-13 14:24:26 +10:00
bfe2dd4ed8 Check for fixup commits on CI (#3742)
I keep merging PRs that still have fixup commits on them! This will make
it impossible to do so

- **PR Description**

- **Please check if the PR fulfills these requirements**

* [ ] Cheatsheets are up-to-date (run `go generate ./...`)
* [ ] Code has been formatted (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
* [ ] Tests have been added/updated (see
[here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)
for the integration test guide)
* [ ] Text is internationalised (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation))
* [ ] Docs have been updated if necessary
* [x] You've read through your own file changes for silly mistakes etc

<!--
Be sure to name your PR with an imperative e.g. 'Add worktrees view'
see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for
examples
-->
2024-07-13 13:51:10 +10:00
7652d579f5 Check for fixup commits on CI
I keep merging PRs that still have fixup commits on them! This will make
it impossible to do so
2024-07-13 13:41:47 +10:00
73bcbe4ee2 Extend icon coverage on remotes and file extensions (#3484)
- **PR Description**

Initially I opened #3426 issue, this PR is targeted to fix that.

- **Please check if the PR fulfills these requirements**

* [X] Cheatsheets are up-to-date (run `go generate ./...`)
* [X] Code has been formatted (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
* [ ] Tests have been added/updated (see
[here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)
for the integration test guide)
* [X] Text is internationalised (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation))
* [X] Docs (specifically `docs/Config.md`) have been updated if
necessary
* [X] You've read through your own file changes for silly mistakes etc

This is the result from the remote icons that I posted on the issue.
Note: The FreeBSD only is triggered if the remote is "git.FreeBSD.org",
note the capitalization

Edit: btw, there are also icons for gitea -> `nf-linux-gitea`, \uf339, 
and forgejo -> `nf-linux-forgejo`, \uf335,  if someone is interested on
some instances that use that sofware.


![image](https://github.com/jesseduffield/lazygit/assets/53124818/d68aa9a1-5a3d-446a-af38-650754056f06)

Would be nice if in the future the user can make overrides via config
file.
```yml
icon_overrides:
  filenames:
    Cargo.toml: 🦀
    Cargo.lock: 🦀
  extensions:
    rs: 🦀
    nix: ❄
```

Fix #3426

<!--
Be sure to name your PR with an imperative e.g. 'Add worktrees view'
see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for
examples
-->
2024-07-13 13:32:26 +10:00
cd01e4e7c2 fixup! Add icons for some file names 2024-07-13 13:23:12 +10:00
c5de9cfd8e fixup! Add icons for some file extensions 2024-07-13 13:23:12 +10:00
1129e0e4a0 Add icons for some git remotes 2024-07-13 13:23:12 +10:00
981f1fa7aa Add icons for some file extensions 2024-07-13 13:23:12 +10:00
cad4581d05 Add icons for some file names 2024-07-13 13:23:12 +10:00