1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-14 11:23:09 +02:00
Commit Graph

3212 Commits

Author SHA1 Message Date
Stefan Haller
e1ceb6892a Disable deadlock reporting when debugging an integration test 2023-09-28 10:03:53 +02:00
Stefan Haller
40b8557608 Disable the 40-second timeout for integration tests when debugging
Pausing at breakpoints and stepping through code can often take longer than 40s,
so the timeout is annoying when debugging.
2023-09-28 10:03:53 +02:00
Stefan Haller
92e107f52d Use constant for WAIT_FOR_DEBUGGER env var 2023-09-28 10:03:53 +02:00
Stefan Haller
2f6a87df98 Build lazygit without optimizations and inlining when debugging
This makes the debugging experience better.
2023-09-28 10:03:53 +02:00
BZ
e72559bb27 respect and env vars 2023-09-25 12:20:12 +02:00
Stefan Haller
59cc6843e6 Print race detector logs after running a test with -race 2023-09-25 09:09:41 +02:00
Stefan Haller
f108fd2236 Support -race arg when running integration tests to turn on go's race detector
For the "cli" and "tui" modes of the test runner there's a "-race" parameter to
turn it on; for running tests on CI with go test, you turn it on by setting the
environment variable LAZYGIT_RACE_DETECTOR to a non-empty value.
2023-09-25 09:09:41 +02:00
Stefan Haller
26d180a50a Fix minor resource leak in runCmdHeadless
We still want to close the pty if the command failed.
2023-09-25 09:09:41 +02:00
Jesse Duffield
c74448f00d Don't select current search result when showing search status
Previously there was no way to render a view's search status without also moving the cursor
to the current search match. This caused issues where we wanted to display the status
after leaving the view and coming back, or when beginning a new search from within the
view.

This commit separates the two use cases so we only move the cursor when we're actually
selecting the next search match
2023-09-25 16:37:59 +10:00
Jesse Duffield
41ab7c44a0
Use upstream branch when opening pull requests (#2693)
- **PR Description**

Should probably solve #2691

- **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
2023-09-25 11:03:15 +10:00
AzraelSec
ea93df571d feat: add a menu to rebase current branch to a target branch upstream 2023-09-24 20:13:59 +02:00
AzraelSec
bc21921001 chore: rename branch upstream view options method 2023-09-22 12:19:38 +02:00
Stefan Haller
fc868cdda5 Shorten the waiting status for fast-forwarding a branch
Now that we no longer show it in a loader panel, but in the app status view,
it's awkwardly long (the loading animation is much further to the right than for
other waiting status texts). Hopefully seeing just "Fast-forwarding <branch>" is
enough to be able to tell what's happening.
2023-09-20 13:56:06 +02:00
Stefan Haller
864a9ada57 Remove unused WithLoaderPanel code 2023-09-20 13:30:49 +02:00
Stefan Haller
f3e9d50d94 Use WithWaitingStatus instead of WithLoaderPanel for pull/push/fetch 2023-09-20 13:30:49 +02:00
Stefan Haller
cdad0b998e Add constant for LoaderAnimationInterval
Since Loader and renderAppStatus need to agree on it, it helps for it to be a
constant in case we want to change it.
2023-09-20 13:30:49 +02:00
Stefan Haller
64012d67a9 Remove unused class FakePopupHandler 2023-09-20 13:30:49 +02:00
Stefan Haller
4c5e250ed8 Add integration test for deleting a remote branch with credentials prompt
This test is interesting because it shows a credentials prompt inside a
WithWaitingStatus. Prior to this branch this test would have hung forever.
2023-09-20 13:29:30 +02:00
Stefan Haller
1359fa14c1 When pausing a task during a waiting status, hide the status while paused
We do this for two reasons:
- when popping up a credentials prompt, it looks distracting if the waiting
  status keeps spinning while the user is typing the password
- the task that updates the waiting status periodically would keep the program
  busy, so integration tests would wait forever for the program to become idle
  again
2023-09-20 13:29:30 +02:00
Stefan Haller
c222a618a8 Extract WaitingStatusHandle 2023-09-20 13:29:11 +02:00
Stefan Haller
05c32e292e Extract StatusManager.addStatus method
Avoids a bit of code duplication.
2023-09-20 11:27:50 +02:00
Jesse Duffield
276438b601
Add history for search view (#2877) 2023-09-20 16:09:53 +10:00
Karim Khaleel
edec116ceb Add search history
Add search history for filterable and searchable views.
2023-09-20 08:35:41 +03:00
Stefan Haller
a642395e9f Allow cherry-picking commits during a rebase
This can be useful when you know that a cherry-picked commit would conflict at
the tip of your branch, but doesn't at the beginning of the branch (or
somewhere in the middle). In that case you want to be able to edit the commit
before where you want to insert the cherry-picked commits, and then paste to
insert them into the todo list at that point.
2023-09-18 10:50:19 +02:00
Stefan Haller
70bfeddc90 Add StatusCommands.IsInNormalRebase and IsInInteractiveRebase
... and implement RebaseMode in terms of these.
2023-09-18 10:50:19 +02:00
Stefan Haller
0b13c3ca87 Disabled paste when there are no copied commits 2023-09-18 10:20:23 +02:00
Stefan Haller
8b6766de79 Use DisabledReason for commits panel commands 2023-09-18 10:20:23 +02:00
Stefan Haller
c9371f812f Use DisabledReason for rebasing a branch onto itself 2023-09-18 10:20:23 +02:00
Stefan Haller
e592d81b60 Add Enabled func to Binding 2023-09-18 10:20:23 +02:00
Stefan Haller
f2f50ccf75 Use DisabledReason for upstream options items 2023-09-18 10:15:11 +02:00
Stefan Haller
75aed98c35 Use DisabledReason when deleting branches is not possible
Two cases: trying to delete the currently checked-out branch, or deleting the
upstream of a branch that doesn't have one.
2023-09-18 10:15:11 +02:00
Stefan Haller
7f9818cfa2 Add DisabledReason field to MenuItem
This is useful to disable items that are not applicable right now because of
some condition (e.g. the "delete branch" menu item when the currently
checked-out branch is selected).

When a DisabledReason is set on a menu item, we
- show it in a tooltip (below the regular tooltip of the item, if it has one)
- strike through the item's key, if it has one
- show an error message with the DisabledReason if the user tries to invoke the
  command
2023-09-18 10:15:11 +02:00
Luka Markušić
4d258bd981 Use UpstreamBranch for opening pull requests 2023-09-18 13:40:52 +10:00
Stefan Haller
c465b0f2ff Rename test/results to test/_results
This prevents commands like "go test ./..." from looking into it, and it
prevents VS Code's Problems panel from showing errors about the go files in that
folder.
2023-09-15 18:04:20 +02:00
AzraelSec
5a740e34c7 fix: use Error method to handle the commit url copy from unknown service 2023-09-12 19:06:08 +02:00
Stefan Haller
b6c892a08a Provide a simple way to debug an integration test 2023-09-11 08:17:58 +02:00
Jesse Duffield
67ac2c5d9b
Change the default of the "gui.borders" config to "rounded" (#2998) 2023-09-10 12:23:25 +10:00
Orlando Maussa
db409fa69f
Add coauthor (#2)
Add co-author to commits

Add addCoAuthor command for commits

- Implement the `addCoAuthor` command to add co-authors to commits.
- Utilize suggestions helpers to populate author names from the suggestions list.
- Added command to gui at `LocalCommitsController`.

This commit introduces the `addCoAuthor` command, which allows users to easily add co-authors to their commits. The co-author names are populated from the suggestions list, minimizing the chances of user input errors. The co-authors are added using the Co-authored-by metadata format recognized by GitHub and GitLab.
2023-09-09 07:18:47 -05:00
Stefan Haller
5b8a8d356c Change the default of the "gui.borders" config to "rounded"
Most people seem to agree that it looks better than the sharp edges of "single".
2023-09-09 10:42:24 +02:00
Maria José Solano
387fbf6ab6 feat: add jump-to-panel label setting 2023-09-09 09:45:08 +02:00
Jesse Duffield
7f9fa64074
Replace whitespace with '-' when renaming a branch (#2990) 2023-09-09 17:34:57 +10:00
AzraelSec
2b7b6f71ee feat: add a menu to reset current branch to a target branch upstream 2023-09-06 08:40:07 +02:00
AzraelSec
47d422bb8a chore: rename "Set/Unset upstream" menu to "Upstream Options"
This should already have been done when adding the "View divergence from
upstream" command, but now we're going to add yet another item to the menu that
is unrelated to setting or unsetting the upstream.
2023-09-06 00:23:35 +02:00
Cal Courtney
c3ca77d6bf Replace whitespace with '-' when renaming a branch 2023-09-05 14:57:18 +01:00
Stefan Haller
7774fe0ab3 Move diff context size from UserConfig to AppState 2023-09-05 13:55:30 +02:00
Stefan Haller
f7db17f7d0 Load defaults for AppState before reading from yaml
So far this hasn't been necessary because all defaults were zero values. We're
about to add the first non-zero value though, and it's important that it is
initialized correctly for users who have a state.yml that doesn't have it yet.
2023-09-04 17:50:49 +02:00
Stefan Haller
1106981827 Extract a SaveAppStateAndLogError function
It seems that most actions that change a state option and resave the state want
to just log the error.
2023-09-04 17:50:49 +02:00
Stefan Haller
1dac4158e9 Don't pass ignoreWhitespace to git commands
Now that AppState is available via common.Common, they can take it from there.
2023-09-04 17:50:49 +02:00
Stefan Haller
18c5780485 Add AppState to common.Common 2023-09-04 17:48:39 +02:00
Stefan Haller
6266e19623 Add support for external diff commands (e.g. difftastic) 2023-09-04 16:52:30 +02:00