jesseduffield.lazygit/vendor/github.com
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
..
atotto/clipboard bump clipboard package for WSL support 2023-04-24 13:33:27 +10:00
aybabtme/humanlog update go to v1.18 2022-03-18 21:36:28 +11:00
cli/safeexec update go to v1.18 2022-03-18 21:36:28 +11:00
cloudfoundry/jibber_jabber switch to Go modules 2019-09-01 21:24:03 +10:00
creack/pty update go to v1.18 2022-03-18 21:36:28 +11:00
davecgh/go-spew switch to Go modules 2019-09-01 21:24:03 +10:00
emirpasic/gods Vendor: Updated dependencies 2019-11-10 23:23:20 +11:00
fatih/color update go to v1.18 2022-03-18 21:36:28 +11:00
fsmiamoto/git-todo-parser Bump git-todo-parser 2023-07-02 02:07:32 -03:00
fsnotify/fsnotify switch to Go modules 2019-09-01 21:24:03 +10:00
gdamore build: bump tcell version 2023-02-21 21:53:55 +09:00
go-errors/errors bump gocui 2022-04-08 12:15:23 +10:00
go-git update go to v1.18 2022-03-18 21:36:28 +11:00
go-logfmt/logfmt update go to v1.18 2022-03-18 21:36:28 +11:00
gobwas/glob suggest files when picking a path to filter on 2021-10-19 09:02:42 +11:00
gookit/color update go to v1.18 2022-03-18 21:36:28 +11:00
imdario/mergo update go to v1.18 2022-03-18 21:36:28 +11:00
integrii/flaggy update go to v1.18 2022-03-18 21:36:28 +11:00
jbenet/go-context bump dependencies 2018-08-09 14:41:58 +10:00
jesseduffield Use first class task objects instead of global counter 2023-07-09 21:30:19 +10:00
kardianos/osext update go to v1.18 2022-03-18 21:36:28 +11:00
kevinburke/ssh_config Vendor: Updated dependencies 2019-11-10 23:23:20 +11:00
konsorten/go-windows-terminal-sequences update go to v1.18 2022-03-18 21:36:28 +11:00
kr/logfmt add in-built logging support for a better dev experience 2020-09-26 11:00:50 +10:00
kyokomi/emoji/v2 update go to v1.18 2022-03-18 21:36:28 +11:00
lucasb-eyer/go-colorful update go to v1.18 2022-03-18 21:36:28 +11:00
mattn build: $ ./scripts/bump_gocui.sh 2022-09-23 20:01:44 +09:00
mgutz/str switch to Go modules 2019-09-01 21:24:03 +10:00
mitchellh/go-homedir update go to v1.18 2022-03-18 21:36:28 +11:00
OpenPeeDeeP/xdg update go to v1.18 2022-03-18 21:36:28 +11:00
petermattis/goid add deadlock mutex package 2022-08-07 11:16:14 +10:00
pmezard/go-difflib add test to utils package 2018-08-19 10:37:03 +02:00
rivo/uniseg build: bump tcell version 2023-02-21 21:53:55 +09:00
sahilm/fuzzy Start on supporting auto-suggestions when checking out a branch 2020-11-28 20:48:17 +11:00
samber/lo use boxlayout from lazycore 2022-10-09 08:31:14 -07:00
sanity-io/litter update go to v1.18 2022-03-18 21:36:28 +11:00
sasha-s/go-deadlock add deadlock mutex package 2022-08-07 11:16:14 +10:00
sergi/go-diff vendor: replace go-git package 2020-03-27 19:06:21 +11:00
sirupsen/logrus update go to v1.18 2022-03-18 21:36:28 +11:00
spkg/bom switch to Go modules 2019-09-01 21:24:03 +10:00
stretchr/testify use boxlayout from lazycore 2022-10-09 08:31:14 -07:00
xanzy/ssh-agent update go to v1.18 2022-03-18 21:36:28 +11:00
xo/terminfo update go to v1.18 2022-03-18 21:36:28 +11:00