summaryrefslogtreecommitdiffstats
path: root/pkg/gui/reflog_panel.go
AgeCommit message (Collapse)Author
2020-03-29add new diff modeJesse Duffield
WIP WIP WIP WIP WIP WIP WIP
2020-03-29split reflog commits into ReflogCommits and FilteredReflogCommitsJesse Duffield
2020-03-29reset state on each Run() callJesse Duffield
2020-03-29rename to filtered modeJesse Duffield
2020-03-29allow scoped mode where the commits/reflog/stash panels are scoped to a fileJesse Duffield
WIP restrict certain actions in scoped mode WIP
2020-03-28better error handlingJesse Duffield
2020-03-28in fact we don't need any of these optionsJesse Duffield
2020-03-28actually don't even bother limitingJesse Duffield
2020-03-28load reflog commits in two stages to speed up startup timeJesse Duffield
2020-03-28discard old reflog commits when in new contextJesse Duffield
2020-03-26only load new reflog entriesJesse Duffield
2020-03-25move into undoing fileJesse Duffield
2020-03-25refactor undo and redoJesse Duffield
2020-03-25stateless undos and redosJesse Duffield
2020-03-25more explicit env varsJesse Duffield
2020-03-25support reflog action prefixJesse Duffield
2020-03-25redoingJesse Duffield
2020-03-25undoing statusJesse Duffield
2020-03-25better formatted reflog listJesse Duffield
2020-03-25use reflog undo history pointerJesse Duffield
2020-03-25autostash changes when hard resettingJesse Duffield
2020-03-25undo via rebaseJesse Duffield
2020-03-09big golangci-lint cleanupJesse Duffield
2020-03-04supporing custom pagers step 1Jesse Duffield
2020-02-25refactor the way we render listsJesse Duffield
2020-02-16add reset to reflog commit menuJesse Duffield
2020-01-12allow fast flicking through any list panelJesse Duffield
Up till now our approach to rendering things like file diffs, branch logs, and commit patches, has been to run a command on the command line, wait for it to complete, take its output as a string, and then write that string to the main view (or secondary view e.g. when showing both staged and unstaged changes of a file). This has caused various issues. For once, if you are flicking through a list of files and an untracked file is particularly large, not only will this require lazygit to load that whole file into memory (or more accurately it's equally large diff), it also will slow down the UI thread while loading that file, and if the user continued down the list, the original command might eventually resolve and replace whatever the diff is for the newly selected file. Following what we've done in lazydocker, I've added a tasks package for when you need something done but you want it to cancel as soon as something newer comes up. Given this typically involves running a command to display to a view, I've added a viewBufferManagerMap struct to the Gui struct which allows you to define these tasks on a per-view basis. viewBufferManagers can run files and directly write the output to their view, meaning we no longer need to use so much memory. In the tasks package there is a helper method called NewCmdTask which takes a command, an initial amount of lines to read, and then runs that command, reads that number of lines, and allows for a readLines channel to tell it to read more lines. We read more lines when we scroll or resize the window. There is an adapter for the tasks package in a file called tasks_adapter which wraps the functions from the tasks package in gui-specific stuff like clearing the main view before starting the next task that wants to write to the main view. I've removed some small features as part of this work, namely the little headers that were at the top of the main view for some situations. For example, we no longer show the upstream of a selected branch. I want to re-introduce this in the future, but I didn't want to make this tasks system too complicated, and in order to facilitate a header section in the main view we'd need to have a task that gets the upstream for the current branch, writes it to the header, then tells another task to write the branch log to the main view, but without clearing inbetween. So it would get messy. I'm thinking instead of having a separate 'header' view atop the main view to render that kind of thing (which can happen in another PR) I've also simplified the 'git show' to just call 'git show' and not do anything fancy when it comes to merge commits. I considered using this tasks approach whenever we write to a view. The only thing is that the renderString method currently resets the origin of a view and I don't want to lose that. So I've left some in there that I consider harmless, but we should probably be just using tasks now for all rendering, even if it's just strings we can instantly make.
2020-01-09add checkout reflog commit keybindingJesse Duffield
2020-01-09add reflog tab in commits panelJesse Duffield