jesseduffield / jesseduffield/lazygit

Keep track of commands history across the sessions

Open
#1,329 3 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Is your feature request related to a problem? Please describe.**
For several times now I discarded something that shouldn't be discarded, and left the lazygit. Trying to be quick bites me in the ass. Discard is not tracked within a reflog, so undo doesn't work in this case.

**Describe the solution you'd like**
Recently you introduced command history, which is really great. It would save my ass if I would check it immediately. Unfortunately I left lazygit and the history was gone. I changed so many files that I lost a track of what I discarded. Having at least the file name that I discarded would help a lot.
My idea is just to keep the history in some cache file, for at least some amount of time. Something like bash does with `.bash_history` or zsh with `.zsh_history`. Of course, this would be an opt-in feature.

**Describe alternatives you've considered**
For now I'll add a `confirmOnQuit` to slow me down a little bit, but I don't know anything else that I could do. Maybe unbind `d` and have discard on something else where I need to think before doing it.

**Additional context**
I believe this shouldn't be too hard to implement, since data is there. It just needs to be appended to the cache file when lazygit is closed.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.