summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/helpers/cherry_pick_helper.go
AgeCommit message (Collapse)Author
2024-04-12rename sha to hash 3pikomonde
2024-04-12rename sha to hashpikomonde
2024-02-10Cleanup: remove unused methodStefan Haller
2024-01-30Clear cherry-picked commits after pastingmolejnik88
It can be tedious after each cherry-pick opearation to clear the selection by pressing escape in order for lazygit to stop displaying info about copied commits. Also, it seems to be a rare case to cherry-pick commits to more than one destination. The simplest solution to address this issue is to clear the selection upon paste. The only exception is a merge conflict. Initially, I wanted to clear selected commits in this scenario too. During a discussion we found out that it may be convenient to have the copied commits still around. Aborting the rebase and pasting the commits in the middle of a branch can be a valid use case.
2024-01-19Support select range for cherry pickJesse Duffield
This requires us to change the 'v' keybinding for paste to something else, now that 'v' is used globally for toggling range select. So I'm using 'shift+v' and I'm likewise changing 'c' to 'shift+c' for copying, so that they're consistent. We will need to clearly communicate this change in keybindings.
2023-09-18Allow cherry-picking commits during a rebaseStefan Haller
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-18Disabled paste when there are no copied commitsStefan Haller
2023-07-10Use an interface for tasks instead of a concrete structJesse Duffield
By using an interface for tasks we can use a fake implementation in tests with extra methods
2023-07-09Use first class task objects instead of global counterJesse Duffield
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-04-30standardise helper argsJesse Duffield
2023-04-30split context common from helper commonJesse Duffield
2023-04-30refactor cherry pick code to move state access out of helperJesse Duffield
2022-03-30pkg/gui: Rename IPopupHandler::Ask() to Confirm()Moritz Haase
Follow the JavaScript naming scheme for user interaction (alert, prompt, confirm) as discussed in #1832.
2022-03-24no more filterThenMapJesse Duffield
2022-03-24would you believe that I'm adding even more genericsJesse Duffield
2022-03-24lots more genericsJesse Duffield
2022-03-24make more use of genericsJesse Duffield
2022-03-17more consistent namingJesse Duffield
2022-03-17refactor controllersJesse Duffield