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

4974 Commits

Author SHA1 Message Date
Stefan Haller
787f9966ec Fix crash when trying to filter the list of remotes
This seems to be a left-over from an earlier iteration of the code. Removing it
fixes the crash.
2023-10-10 08:33:18 +02:00
Stefan Haller
013cfc77a1
Show sync status in branches list (#3021) 2023-10-10 08:32:42 +02:00
Jesse Duffield
16f7b01fec
Add disabled compat for user config (#2833) (#3060) 2023-10-10 16:49:31 +11:00
Karim Khaleel
421c6565f9 Update wording in disable keybindings test
Co-authored-by: Jesse Duffield <jessedduffield@gmail.com>
2023-10-10 08:38:15 +03:00
Karim Khaleel
d02deeefd8 Add disabled compat for user config (#2833)
Treat <disabled> setting as equivalent to "null"
in keybindings user configs.
2023-10-09 22:34:50 +03:00
Stefan Haller
235f5bb221 Avoid rendering branches view twice when refreshing
refreshWorktrees re-renders the branches view, because the branches view shows
worktrees against branches. This means that when both BRANCHES and WORKTREES are
requested to be refreshed, the branches view would be rendered twice in short
succession. This causes an ugly visual glitch when force-pushing a branch,
because when pushing is done, we would see the ↑4↓9 status come back from under
the Pushing status for a brief moment, to be replaced with a green checkmark a
moment later.

Fix this by including the worktree refresh in the branches refresh when both are
requested. This means that the two are no longer running in parallel for an
async refresh, but hopefully that's not so bad.
2023-10-08 18:45:36 +02:00
Stefan Haller
be3b4bd791 Remove sync mutex
I'm pretty convinced we don't need it. Git itself does a good job of making sure
that concurrent operations don't corrupt anything.
2023-10-08 18:45:36 +02:00
Stefan Haller
67d6447e12 Disallow pulling/pushing a branch while the branch is pushed or pulled 2023-10-08 18:45:36 +02:00
Stefan Haller
fd9d7cb7bb Disallow checking out another branch while the current one is being pulled 2023-10-08 18:45:36 +02:00
Stefan Haller
3d6965ccbb Add inline status for pushing tags and deleting remote tags 2023-10-08 18:45:36 +02:00
Stefan Haller
707fa37160 Add inline status for pushing/pulling/fast-forwarding branches
When pulling/pushing/fast-forwarding a branch, show this state in the branches
list for that branch for as long as the operation takes, to make it easier to
see when it's done (without having to stare at the status bar in the lower
left).

This will hopefully help with making these operations feel more predictable, now
that we no longer show a loader panel for them.
2023-10-08 18:45:36 +02:00
Stefan Haller
7075b66bc6 Add WithInlineStatus helper function
Very similar to WithWaitingStatus, except that the status is shown in a view
next to the affected item, rather than in the status bar.

Not used by anything yet; again, committing separately to get smaller commits.
2023-10-08 18:45:36 +02:00
Stefan Haller
9d55d71fdd Add GetItemOperation/SetItemOperation/ClearItemOperation to IStateAccessor
Not used by anything yet; committing this separately in the interest of having
smaller independent commits.
2023-10-08 18:30:57 +02:00
Stefan Haller
cc9a20c4ab Don't report errors from within a WithWaitingStatus
We can just return our error to WithWaitingStatus, it will take care of
reporting it.
2023-10-08 18:30:34 +02:00
README-bot
c39fafe6ec Updated README.md 2023-10-04 23:33:09 +00:00
Jesse Duffield
2a11725749
Remove redundant len check (#3051) 2023-10-05 10:32:53 +11:00
Eng Zer Jun
deed9eb18e
Remove redundant len check
From the Go specification [1]:

  "3. If the map is nil, the number of iterations is 0."

`len` returns 0 if the map is nil [2]. Therefore, checking `len(v) > 0`
before a loop is unnecessary.

[1]: https://go.dev/ref/spec#For_range
[2]: https://pkg.go.dev/builtin#len

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-10-04 21:03:26 +08:00
Sebastian
50b49ebeb1
Merge branch 'jesseduffield:master' into feature/keybinding-branch-recent 2023-10-04 09:42:53 +02:00
Sebastian Mangelsen
a74c6eef40 adjust the text to received review comments 2023-10-04 09:41:00 +02:00
README-bot
a3759c65e4 Updated README.md 2023-10-03 19:20:39 +00:00
Stefan Haller
519760077b
Add Micro editor preset (#3049) 2023-10-03 21:20:21 +02:00
Nikita Karamov
8390622f70
Add Micro editor preset 2023-10-03 19:42:28 +02:00
README-bot
a04fbafcfd Updated README.md 2023-10-03 09:35:18 +00:00
Stefan Haller
4fe8dee40f
Band-aid fix for submodule/reset.go test failure (#3047) 2023-10-03 11:34:59 +02:00
Stefan Haller
6fd80565c7 Band-aid fix for submodule/reset.go test failure
This is not a complete fix, but it's good enough to fix the spurious test
failures of submodule/reset.go. We have some vague hope to fix this in a more
sustainable way by somehow improving our concurrency model fundamentally, but
that's a more long-term undertaking, and it's annoying that this test fails so
often, so let's fix it in this way for now.
2023-10-03 09:36:46 +02:00
Sebastian Mangelsen
5ebd8ac7fe commmit - enhance docs for keybinding 'c' for local branch
- closes #3030
- mention that it supports '-'
- fix documentation and builtin help
2023-10-02 18:06:24 +02:00
README-bot
3cda1d03d9 Updated README.md 2023-10-01 06:05:28 +00:00
Stefan Haller
d4eb02fac0
Add ability to force portrait mode (#3037) 2023-10-01 08:05:13 +02:00
Louis DeLosSantos
9c72d8a2b0 Add ability to force portrait mode
A new gui config flag 'portraitMode':<string> is added to influence when
LazyGit stacks its UI components on top of one another.

The accepted values are 'auto', 'always', 'never'.

'auto': enter portrait mode when terminal becomes narrow enough

'always': always use portrait mode unconditional of the terminal
dimensions

'never': never use portraid mode

Signed-off-by: Louis DeLosSantos <louis.delos@gmail.com>
2023-09-30 20:57:38 +02:00
Jesse Duffield
4f3127ccb8
Update PR template to use go generate command (#3041) 2023-09-30 20:06:58 +10:00
Jesse Duffield
877c27722f add gofumpt to workspace settings 2023-09-30 19:46:03 +10:00
Jesse Duffield
0dda8b58d1 Update PR template to use go generate command 2023-09-30 19:45:55 +10:00
Jesse Duffield
e997d1ae5d
Add comments in user config struct (#3040) 2023-09-30 19:39:42 +10:00
Jesse Duffield
3e2ef84d56 Ignore deprecation checks in linter
This is pretty funny: the staticcheck linter gets mad if we use a field which is marked
in a comment as being deprecated. But it tripped on my own comment saying that a field
is deprecated in terms of the user config!

Obviously we have to make use of this field, otherwise we would just remove it entirely
rather than mark it as deprecated, so I'm silencing this lint.

I doubt this lint would actually come in handy in other cases (like when using a third
party package) and worst case scenario we just end up fixing the problem when we
try to upgrade the package and the deprecated field is now gone).
2023-09-30 19:24:59 +10:00
Jesse Duffield
b2eccd6fe8 Add comments in user config struct
We're going to make this user config struct a more authoritative source of truth.

Some of these fields weren't actually explained anywhere so I've added explanations.

In places where a lot of explanation is required I've linked to existing explanations in other docs.
2023-09-30 19:23:52 +10:00
Stefan Haller
cc25a3b8c5
Change Makefile to build non-optimized (#3028) 2023-09-30 10:59:22 +02:00
Stefan Haller
e93d945dba Change Makefile to build non-optimized 2023-09-30 10:50:32 +02:00
README-bot
246e08096f Updated README.md 2023-09-30 08:46:30 +00:00
Stefan Haller
860a52a736
Use go:generate for cheatsheet (#3035) 2023-09-30 10:46:16 +02:00
Stefan Haller
18d8b29461 Make test_list_generator.go print what it's doing
It's confusing if the cheatsheet generator prints output but this one doesn't.
2023-09-29 20:40:15 +02:00
Stefan Haller
7af371701d Use go:generate for generating cheatsheets
This has several benefits:
- it's less code
- we're using the same mechanism to generate all our auto-generated files, so if
  someone wants to add a new one, it's clear which pattern to follow
- we can re-generate all generated files with a single command
  ("go generate ./...", or "make generate")
- we only need a single check on CI to check that all files are up to date (see
  previous commit)
2023-09-29 20:38:29 +02:00
Stefan Haller
5ccc95b76f Generalize the CI check for the test list to all auto-generated files
At the moment, test_list.go is the only file that we generate using go:generate.
We will add another one in the next commit though, and we might add even more in
the future; it's useful to have a single check on CI that checks them all.
2023-09-29 20:20:09 +02:00
README-bot
cdb1d76484 Updated README.md 2023-09-28 08:04:37 +00:00
Stefan Haller
9e423e949c
Improve debugging of integration tests (#3029)
Several improvements to make debugging integration tests work better.
2023-09-28 10:04:23 +02:00
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
Jesse Duffield
2c29577e3c
Respect $GIT_WORK_TREE and $GIT_DIR env vars (fix #3010). (#3024) 2023-09-26 23:52:19 +10:00
BZ
e72559bb27 respect and env vars 2023-09-25 12:20:12 +02:00