I was thinking this article would give me a way to automatically commit every time the compilation succeeds after a write with an automatic timestamp commit message. I think people here would find it horrendous because of the unhelpful commit messages but then nothing would prevent to edit the last commit message when you have implemented something meaningful. Just throwing ideas, don't shoot this post down.
Kent Beck wrote up a workflow along these lines called test && commit || revert. The idea is any change that makes the tests pass is committed, any change that makes the tests fail is reverted. https://medium.com/@kentbeck_7670/test-commit-revert-870bbd7...
I believe Kent has also posted a few videos on YouTube demonstrating this approach.