News for hackers. Stuff that matters.
Re:Git as a Storage by yepguy on Friday October 08, 2021 @03:13PM (#28802947)
Emacs kind of has this in the form of magit-wip-mode. It doesn't sync with the undo system but it does persist every file save event since the last "real" commit.
Re:Git as a Storage by muixoozie on Friday October 08, 2021 @06:10PM (#28804717)
I need to look into this.

Just yesterday I lost some work (only maybe 10 minutes worth) when I was updating my org notes. I staged some files, committed them, but made a typo in the commit message. I ended up reverting the commit when I meant to amend. Then I discarded the the staged reverted changes and noticed the status said I was still reverting. So I looked up the command to get me out of that state. I ran 'git revert --abort' and it blew away my unstaged changes. Ah well, those versioned backups I have Emacs do are going to save me this time, or so I thought.

Re:Git as a Storage by minikomi on Friday October 08, 2021 @08:38PM (#28805892)
If you did actually commit, you should be able to find the changes on the reflog

In magit, it's accessable from the log menu

Create a branch, reset it to the badly worded commit hash and then you can try to ammend again.

Re:Git as a Storage by muixoozie on Friday October 08, 2021 @10:56PM (#28806620)
I was breaking a bunch of unstaged changes into two commits, and the part I lost had not been committed.