A stupid little script to automatically commit edits to blog posts, or just about anything else, as a form of shotgun version control.
More detail can be found in the blog post that spawned the script.
Feel free to fork it; it's inelegant and applies no useful description to each commit. I also welcome emails telling me how idiotic and crappy my script is.
How to Use It
git clone https://github.com/koralatov/autoblogit
mv .abg-commit-prep.sed .abg-commit.log .gitignore README.md autoblogit.sh ~/Documents/Blog
chmod 700 autoblogit.sh
- Set up
launchdto run the script periodically.
- The script assumes your blog posts (or whatever else you want to track) are kept in
~/Documents/Blog. Change that if the files live somewhere else.
- It's less tidy than it could be, but in the above setup I've moved the script and all of its files into your blog's directory. This is just to keep things simple. In a later revision I might tidy that up.
- The description is now somewhat useful, though far from ideal. It parses the output of
sedto create an ugly-but-descriptive commit message. It's still far from ideal, but it does at least mean your commit log contains decipherable commit messages.
- If you're running Max OS X, which has deprecated
cronin favour of
launchd, I recommend (and use myself) Peter Borg's excellent Lingon app. It makes setting up scheduled
launchdevents much easier.
- I accept no responsibility if this causes your system to eat itself.