1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-27 00:51:18 +02:00
Commit Graph

5626 Commits

Author SHA1 Message Date
ef99e47d09 Fix amend to operation not working with non-HEAD merge commit 2024-04-22 08:48:59 -07:00
580818e935 pkg: fix some typos (#3364) 2024-04-20 13:49:43 +02:00
1c098ff82a pkg: fix some typos
Signed-off-by: thirdkeyword <fliterdashen@gmail.com>
2024-04-20 13:47:39 +02:00
34f8f7293c Simplify error handling (#3502)
- **PR Description**

Simplify and canonicalize error handling across the code base.

Previously it was important to make sure that errors don't bubble up
into gocui, because it would panic there; so we had to show errors in
error panels in the right places (in controller code, usually). This is
error-prone because it's easy to forget (see #3490 for an example);
also, it's not always obvious where in the call chain the error panel
needs to be shown. Most of the time it's in controller code, but we had
plenty of calls to `Error()` in helpers, and I remember that I found
this very confusing when I was new to the code base.

Change this so that you can simply return errors everywhere. The
functions to show an error message manually have been removed for
clarity.

I tried to structure the commits so that you can review them one by one.

Closes #3491.
2024-04-18 10:14:51 +02:00
caad553502 Remove ErrorMsg
There is no reason any more for application code to show error messages in a
panel. Just return an error instead.
2024-04-18 10:10:30 +02:00
723b92916d Rename Error() to ErrorHandler()
It is now only used as the error handler that is passed to gocui.Gui on
construction; it's not a client-facing API any more. Also, it doesn't have to
handle gocui.ErrQuit, as gocui takes care of that.
2024-04-18 10:10:30 +02:00
653994845e Return error from RefreshOptions.Then 2024-04-18 10:10:30 +02:00
bbad3a70ce Log errors from refresh instead of showing them in a panel
We are already doing this in other cases in this file.
2024-04-18 10:10:30 +02:00
1869fda800 Make OnWorker callback return an error
This lets us get rid of a few more calls to Error(), and it simplifies things
for clients of OnWorker: they can simply return an error from their callback
like we do everywhere else.
2024-04-18 10:10:30 +02:00
5396a70661 Clean up error handling of WithWaitingStatus and WithWaitingStatusSync 2024-04-18 10:10:30 +02:00
82a3d33ce3 Remove calls to Error()
Now that we have an error handler set, we can simply let them bubble up all the
way to gocui.
2024-04-18 10:10:30 +02:00
325800a72e Set ErrorHandler 2024-04-18 10:10:30 +02:00
9f8ae76189 Bump gocui
In Gui.onWorker we only make the minimum possible change to get things to
compile after the API-breaking change of the gocui update; we'll make this
cleaner later in this branch.
2024-04-18 10:10:30 +02:00
8a77e51576 Remove PopupHandler index and mutex
It doesn't seem to be used.
2024-04-16 10:03:35 +02:00
145795c0b0 README.md: Update Sponsors (#3498)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2024-04-16 09:25:11 +10:00
cbe6dd7b2f README.md: Update Sponsors 2024-04-15 23:24:36 +00:00
b6ca9090f4 exclude sponsors PRs from release notes (#3499)
- **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 (specifically `docs/Config.md`) have been updated if
necessary
* [ ] 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-04-16 09:24:21 +10:00
5d13e3cf76 exclude sponsors PRs from release notes 2024-04-16 09:23:37 +10:00
9e5ceaa1ec sponsors.yml: Create PR instead of trying to push to a protected branch (#3493)
- **PR Description**
Uses [this popular-ish
action](https://github.com/marketplace/actions/create-pull-request) to
create a PR.

> How the action behaves:
> 
> If there are changes (i.e. a diff exists with the checked-out base
branch), the changes will be pushed to a new branch and a pull request
created.
> If there are no changes (i.e. no diff exists with the checked-out base
branch), no pull request will be created and the action exits silently.
> If a pull request already exists it will be updated if necessary.
Local changes in the Actions workspace, or changes on the base branch,
can cause an update. If no update is required the action exits silently.
> If a pull request exists and new changes on the base branch make the
pull request unnecessary (i.e. there is no longer a diff between the
pull request branch and the base), the pull request is automatically
closed. Additionally, if
[delete-branch](https://github.com/marketplace/actions/create-pull-request#delete-branch)
is set to true the branch will be deleted.

Demo Action Run:
https://github.com/SachinVin/lazygit/actions/runs/8675283475
Demo PR: https://github.com/SachinVin/lazygit/pull/2

You also might want to consider changing this action to trigger as a
cron job instead on pushes to master.

- **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 (specifically `docs/Config.md`) 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-04-16 09:09:06 +10:00
ba0c00b5d1 sponsors.yml: Create PR instead of trying to push to a protected branch 2024-04-13 22:59:55 +05:30
145fb6191c standardize commit hash commit sha (#3398)
Standardise on use of 'commit hash' rather than 'commit SHA'
Close: https://github.com/jesseduffield/lazygit/issues/3208
2024-04-12 08:37:30 +02:00
7e14d88dc9 Support both Sha and Hash on commits in custom commands
We achieve this by wrapping the model Commit in a custom struct that provides
both.
2024-04-12 08:33:47 +02:00
e6a07b3f03 Add integration test that accesses commit properties in a custom command
Useful as a regression test to check that the following commit doesn't break it.
2024-04-12 08:33:47 +02:00
28923fc9d0 improve korean translation 2024-04-12 08:33:47 +02:00
19bef17042 rename sha to hash 10, last remaining sha (hopefully) 2024-04-12 08:33:47 +02:00
170c4ecb8c rename sha to hash 9, case: Sha 2024-04-12 08:33:47 +02:00
de1c495704 rename sha to hash 8, update some log and comment 2024-04-12 08:33:47 +02:00
fccfbf1f63 rename sha to hash 7, language translate 2024-04-12 08:33:47 +02:00
05fb12b1d5 rename sha to hash 6, update short hash 2024-04-12 08:33:47 +02:00
9cf1ca10a2 rename sha to hash 5 2024-04-12 08:33:47 +02:00
dc6863b83d rename sha to hash 4 2024-04-12 08:33:47 +02:00
13af335b37 rename sha to hash 3 2024-04-12 08:33:47 +02:00
92aab21d3a rename sha to hash 2 2024-04-12 08:33:47 +02:00
e6ef1642fa rename sha to hash 2024-04-12 08:33:47 +02:00
84333eebc3 renaming variable to CommitHash 2024-04-12 08:33:47 +02:00
7f6eea2a55 standardize 'Commit Sha' to 'Commit Hash' 2024-04-12 08:31:40 +02:00
06624e85d6 Add StatusPanelView config (#3309)
Adds a new config `statusPanelView ` which allows you to select the
default view of the main window: `dashboard` (default),
`allBranchesLog`.
2024-04-10 17:43:36 +02:00
5616d6a9bc Dynamic copyright year 2024-04-10 17:38:57 +02:00
5c3aacb4cb UserConfig validation 2024-04-10 17:38:57 +02:00
2b5c814080 Add StatusPanelView config 2024-04-10 17:38:57 +02:00
4ba85608c8 Fix stderr redirection (#3479)
- **PR Description**

Seems that there's a problem in the Stdout/Stderr/Stdin stream vars
assignments,
probably copy-paste issue.

If this is intentional, I suggest adding an explanation on why `Stderr`
-> `Stdout` intentionally to avoid other PRs and confused people around
:)

Thanks!
2024-04-09 09:10:35 +02:00
a63c660f28 Fix stderr redirection
Seems that there's a problem in the Stdout/Stderr/Stdin vars
assignments, probably copy-paste issue.
2024-04-09 09:08:14 +02:00
fab7ca2b58 Fix issue #3308 (#3478)
- **PR Description**

It seems that setting TERM=dumb breaks compatibility with curses
subprocess in Go, especially with `pinentry-curses`

This fixes #3308
2024-04-09 09:07:44 +02:00
7b0e06d885 TERM: remove TERM variable hard-coded value set 2024-04-09 04:15:03 +02:00
426375b7cd Replace min/max helpers with built-in min/max (#3482)
- **PR Description**

We upgraded our minimum Go version to 1.21 in commit
57ac9c2189. We can now replace our
`utils.Min` and `utils.Max` functions with the built-in `min` and `max`.

Reference: https://go.dev/ref/spec#Min_and_max

- **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)
* [ ] Text is internationalised (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation))
* [ ] Docs (specifically `docs/Config.md`) 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-04-08 09:31:14 +10:00
f933a2f7ec Replace min/max helpers with built-in min/max
We upgraded our minimum Go version to 1.21 in commit
57ac9c2189. We can now replace our
`utils.Min` and `utils.Max` functions with the built-in `min` and `max`.

Reference: https://go.dev/ref/spec#Min_and_max
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2024-04-07 23:24:10 +08:00
ed61b9a7f2 pkg: fix some comment (#3481) 2024-04-07 11:06:42 +02:00
d8c1eb879b pkg: fix some comment
Signed-off-by: hongkuang <liurenhong@outlook.com>
2024-04-07 16:09:26 +08:00
c02408bba0 Add spinner config options (#3463)
- **PR Description**

Add `spinner` config section to the user config. The section has 2
options:
- `frames` - list of strings that are iterated in the spinner animation
- `rate` - spinner's rate in milliseconds

Closes #3435
2024-04-06 13:49:51 +02:00
f3dba743f0 Add SpinnerConfig
This new config section allows to customize frames and rate of
thespinner
2024-04-06 13:46:15 +02:00