Building simplicidade.org: notes, projects, and occasional rants

Auto-save

Jack Moffitt was bitten by auto-save.

My auto-save setup is "Save when TextMate looses focus" but yesterday I was scripting something better that will be a great auto-save post-script.

When I start to work on something experimental, I would like to have a snapshot of every path I take and undo. Sometimes I write some code, and then say "naahhh, wont work ok", and undo it, without any record. And this is bad, because some of those actually were a good path after all.

Right now, the script does some git add voodoo and a git commit, so that I have a commit of the entire workspace each 2 minutes.

I'm still tweaking some details: I would like these commits to exist in a parallel repository, not my main one, so I'm playing with having a second .git control directory inside the main one.

Anyway, if you auto-save could also commit the file to a changes repository, then you would have all the changes since you started.