1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-04 10:34:55 +02:00
Commit Graph

385 Commits

Author SHA1 Message Date
Jesse Duffield
14ecc15e71 Use first class task objects instead of global counter
The global counter approach is easy to understand but it's brittle and depends on implicit behaviour that is not very discoverable.

With a global counter, if any goroutine accidentally decrements the counter twice, we'll think lazygit is idle when it's actually busy.
Likewise if a goroutine accidentally increments the counter twice we'll think lazygit is busy when it's actually idle.
With the new approach we have a map of tasks where each task can either be busy or not. We create a new task and add it to the map
when we spawn a worker goroutine (among other things) and we remove it once the task is done.

The task can also be paused and continued for situations where we switch back and forth between running a program and asking for user
input.

In order for this to work with `git push` (and other commands that require credentials) we need to obtain the task from gocui when
we create the worker goroutine, and then pass it along to the commands package to pause/continue the task as required. This is
MUCH more discoverable than the old approach which just decremented and incremented the global counter from within the commands package,
but it's at the cost of expanding some function signatures (arguably a good thing).

Likewise, whenever you want to call WithWaitingStatus or WithLoaderPanel the callback will now have access to the task for pausing/
continuing. We only need to actually make use of this functionality in a couple of places so it's a high price to pay, but I don't
know if I want to introduce a WithWaitingStatusTask and WithLoaderPanelTask function (open to suggestions).
2023-07-09 21:30:19 +10:00
Jesse Duffield
9e79ee5fe3 Add dev doc for busy/idle tracking 2023-07-09 20:57:18 +10:00
Jesse Duffield
4d734d594a Add filtering docs 2023-07-03 12:54:14 +10:00
Jesse Duffield
b625eb5323 Differentiate between different filter modes
We can filter by path, by file status, and by text.
2023-07-03 12:54:14 +10:00
Jesse Duffield
db7b472f9a Update cheatsheets 2023-07-03 12:54:14 +10:00
Jesse Duffield
9df634f13f Color view frame differently when searching/filtering
Given that we now persist search/filter states even after a side context loses focus, we need to make it really
clear to the user that the context is currently being searched/filtered
2023-07-03 12:54:14 +10:00
Amirzhan Aliyev
5133113142 feat(i18n): add russian translation 2023-06-28 00:34:59 +06:00
Stefan Haller
ee03a0be41 Rename "Delete change" menu entry to "Discard change" in staging panel
For consistency with the previous commit.

Note that this menu entry is used both for unstaged and for staged changes, and
for staged changes it is not quite accurate, as we are not discarding changes in
that case (just unstaging them). Not sure it's worth fixing this; it's still
better than "Delete", anyway.
2023-06-26 08:19:58 +02:00
Stefan Haller
51a558040d Fix the title and text (and variable names) of the Discard Changes prompt
The title was saying "Unstage lines", which was just wrong. The text said
"Delete lines", which can be seen as a bit misleading; we are only discarding
the changes to the selected lines, not deleting the lines themselves.

For consistency, rename the config variable skipUnstageLineWarning accordingly.
2023-06-26 08:15:35 +02:00
Stefan Haller
77c5d1761d Add nerdFontsVersion config 2023-06-15 21:47:52 +02:00
Jesse Duffield
a694c458dd Support authors and tags in custom command suggestions preset 2023-06-07 10:18:01 +10:00
Jesse Duffield
a4db44bc3d show commits against branches 2023-06-01 19:21:24 +10:00
Stefan Haller
31a2ea1f19 Add --all to "git fetch" command when not fetching a specific remote 2023-06-01 10:13:14 +02:00
Jesse Duffield
614a30134c
Merge pull request #2688 from tzengyuxio/master 2023-05-31 09:36:12 +10:00
Tzeng Yuxio
6754335b26
Add key bindings doc for Chinese 2023-05-30 20:30:30 +08:00
Jesse Duffield
1de876ed4d Support using command output directly in menuFromCommand custom command prompt
The menuFromCommand option is a little complicated, so I'm adding an easy way to just use the command output directly,
where each line becomes a suggestion, as-is.

Now that we support suggestions in the input prompt, there's less of a need for menuFromCommand, but it probably still
serves some purpose.

In future I want to support this filter/valueFormat/labelFormat thing for suggestions too. I would like to think a little more
about the interface though: is using a regex like we currently do really the simplest approach?
2023-05-29 22:52:16 +10:00
Jesse Duffield
036a1ea519 Support suggestions generated from command in custom commands
This changes the interface a bit but it was only added earlier today so I doubt anybody is dependent on it yet.

I'm also updating the docs.
2023-05-29 22:47:35 +10:00
Jesse Duffield
16fa22a36e Add suggestionsPreset to custom commands system 2023-05-29 14:24:49 +10:00
Jesse Duffield
0e0458f355 More compact and flexible date format
You can now configure both a time format and a short time format, where the short format kicks in
when the time is within the last day
2023-05-26 17:31:39 +10:00
Jesse Duffield
d772c9f1d4 Use sentence case everywhere
We have not been good at consistent casing so far. Now we use 'Sentence case' everywhere. EVERYWHERE.

Also Removing 'Lc' prefix from i18n field names: the 'Lc' stood for lowercase but now that everything
is in 'Sentence case' there's no need for the distinction.

I've got a couple lower case things I've kept: namely, things that show up in parentheses.
2023-05-25 23:52:19 +10:00
dvic
ed496deeca
Add helix editor preset 2023-05-24 23:08:26 +02:00
Jesse Duffield
3eed997161 Update cheatsheet
Now that we're using the angle-bracket syntax everywhere for consistency, we need to escape
the angle brackets in the markdown of the cheatsheets.
2023-05-21 11:31:29 +10:00
Jesse Duffield
820f7b9404 Support strikethrough text style 2023-05-21 10:46:13 +10:00
Stefan Haller
46b93bba0e Add config git.mainBranches
It defaults to {"master", "main"}, but can be set to whatever branch names
are used as base branches, e.g. {"master", "devel", "v1.0-hotfixes"}. It is
used for color-coding the shas in the commit list, i.e. to decide whether
commits are green or yellow.
2023-05-16 13:20:03 +02:00
Jesse Duffield
7c66ca83c1 update cheatsheets 2023-05-11 19:02:25 +10:00
Jesse Duffield
2b30085dba Merge branch 'master' into refactor-better-encapsulation 2023-05-11 19:00:01 +10:00
Christian Rackerseder
1636931c2b
Include "kakoune" in supported edit presets 2023-05-04 08:28:58 +02:00
Christian Rackerseder
6e027f42da
Include "nvim" in supported edit presets 2023-05-03 13:30:51 +02:00
Jesse Duffield
c88ecdf87c update open docs 2023-05-03 13:48:04 +10:00
Jesse Duffield
5dacbb6293 merge master into refactor-better-encapsulation 2023-05-02 19:05:42 +10:00
Stefan Haller
fba1a2b5ac Add config gui.experimentalShowBranchHeads
People find the new (*) display for branch heads in the commits list confusing,
so make it opt-in for now.
2023-05-02 18:58:54 +10:00
Sean
9d68b287db Split commit message panel into commit summary and commit description panel
When we use the one panel for the entire commit message, its tricky to have a keybinding both for adding a newline and submitting.
By having two panels: one for the summary line and one for the description, we allow for 'enter' to submit the message when done from the summary panel,
and 'enter' to add a newline when done from the description panel. Alt-enter, for those who can use that key combo, also works for submitting the message
from the description panel. For those who can't use that key combo, and don't want to remap the keybinding, they can hit tab to go back to the summary panel
and then 'enter' to submit the message.

We have some awkwardness in that both contexts (i.e. panels) need to appear and disappear in tandem and we don't have a great way of handling that concept,
so we just push both contexts one after the other, and likewise remove both contexts when we escape.
2023-04-30 13:19:53 +10:00
Jesse Duffield
dd31f8ecea update cheatsheets 2023-04-30 13:19:53 +10:00
Sean
49da7b482d Split commit message panel into commit summary and commit description panel
When we use the one panel for the entire commit message, its tricky to have a keybinding both for adding a newline and submitting.
By having two panels: one for the summary line and one for the description, we allow for 'enter' to submit the message when done from the summary panel,
and 'enter' to add a newline when done from the description panel. Alt-enter, for those who can use that key combo, also works for submitting the message
from the description panel. For those who can't use that key combo, and don't want to remap the keybinding, they can hit tab to go back to the summary panel
and then 'enter' to submit the message.

We have some awkwardness in that both contexts (i.e. panels) need to appear and disappear in tandem and we don't have a great way of handling that concept,
so we just push both contexts one after the other, and likewise remove both contexts when we escape.
2023-04-30 12:17:34 +10:00
Noah Gao
bf3dd79b7a feat: add gitea to hosting service 2023-04-18 16:16:09 +00:00
Stefan Haller
e3c5e07b20 Update documentation 2023-04-13 13:14:00 +02:00
Jesse Duffield
a82d952f48
Merge pull request #2495 from jesseduffield/feature/remove-altreturn 2023-03-20 20:11:35 +11:00
Jens Kutilek
5c8bc790ff
Make arrows consistent (#2501) 2023-03-18 11:32:44 +11:00
yk-kd
b5d612e6d6
Add border config (#2344)
Co-authored-by: yk-kd <yosuke.komada@gmail.com>
2023-03-18 11:23:31 +11:00
Luka Markušić
f314cb3763 Remove alternative confirmation and return keymappings 2023-03-09 10:32:00 +01:00
Tyler Barnes
6735bf4c89
Update Config.md 2023-03-07 11:54:47 -08:00
Jesse Duffield
56424eb1aa remove x keybinding for opening menu so we now only use '?' 2023-02-20 19:28:45 +11:00
Ryooooooga
67b08ac239
feat: support to create tag on branch 2023-02-19 23:31:46 +09:00
Luka Markušić
8af59c3e6e Copy remote branch name to clipboard 2023-02-09 11:56:12 +01:00
stk
d838965a41 Make "Toggle whitespace in diff view" a global key binding
Since it is going to affect a number of views later in the branch, it's easier
to make it global than to find all views that are affected.
2023-02-07 09:25:38 +01:00
Phanindra Kumar Paladi
01f0efb997
Merge branch 'master' into #2319_default_screen_mode 2023-01-29 10:25:14 +05:30
Jesse Duffield
996a1e469f
Merge pull request #2401 from Ryooooooga/disable-log-order 2023-01-29 14:05:31 +11:00
Ryooooooga
2183c157d4
feat(log): allow to disable git.log.order 2023-01-28 21:17:05 +09:00
stk
67fb28e2b8 Add user config gui.skipRewordInEditorWarning 2023-01-26 09:01:22 +01:00
Jesse Duffield
fd86d29400
Merge pull request #2343 from Ryooooooga/commit-verbose 2023-01-17 09:19:22 +11:00