summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/commits_files_controller.go
AgeCommit message (Collapse)Author
2024-01-09Add command to open git difftoolStefan Haller
2023-09-04Don't pass ignoreWhitespace to git commandsStefan Haller
Now that AppState is available via common.Common, they can take it from there.
2023-07-31Move IgnoreWhitespaceInDiffView to AppState, and persist it when it changesStefan 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-06-07Allow discarding changes only from local commitsStefan Haller
We use CommitFilesController also for the files of commits that we show elsewhere, e.g. for branch commits, tags, or stashes. It doesn't make sense to discard changes from those (for stashes it might be possible to implement it somehow, but that would be a new feature), so we disallow it unless we are in the local commits panel.
2023-06-07Better prompt for discarding old file changesStefan Haller
Lazygit knows what kind of file change this is, so there doesn't have to be any "if" in the prompt text.
2023-06-07Disallow discarding file changes while a directory is selectedStefan Haller
Discarding changes to an entire directory doesn't quite work correctly in all cases; for example, if the current commit added files to the directory (but the directory existed before) then those files won't be removed. It might be possible to fix the command so that these cases always work for directories, but I don't think it's worth the effort (you can always use a custom patch for that), so let's display an error for now.
2023-05-25Use sentence case everywhereJesse Duffield
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-20Visualize the "ignore whitespace" state in the subtitle of the diff viewStefan Haller
2023-04-30fix rendering of commit files viewJesse Duffield
2023-04-30lots of changesJesse Duffield
2023-04-30standardise controller helper methodsJesse Duffield
2023-03-19rename patch manager to patch builderJesse Duffield
2022-08-06refactor to only have one context per viewJesse Duffield
2022-07-31refactor to use generics for file nodesJesse Duffield
use less generic names
2022-04-02introduce Ref interfaceRyooooooga
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-23allow adding whole diff to patchJesse Duffield
this was causing a panic add integration test for toggling all commit files
2022-03-19update lintersJesse Duffield
2022-03-19use generics to DRY up context codeJesse Duffield
2022-03-17fix click handlingJesse Duffield
2022-03-17better namingJesse Duffield
2022-03-17add commit files controllerJesse Duffield