Much better to use etckeeper instead of your own home-grown solution. There are number of gotchas that etckeeper addresses nicely. It's a package in several Linux distros, and is also easy to build from source.

A really nice feature on Debian-based systems is that it ties in with apt to automatically commit before and after installing or updating packages. This helps distinguish changes you made yourself from ones made by package updates. It also (optionally) does a daily autocommit.