Editing configuration files
All config files under /etc are under version control (by etckeeper+git) Essentially you use git as if there was no etckeeper (for a short git introduction see http://schacon.github.com/git/everyday.html ), except for committing (see below). The sysadmins get an email every time something is commited.
How to commit changes
Although it is possible to commit changes directly with the git commands you should use "etckeeper commit [optional commit message]". This will notice that you used su and fill in your original name ,so if your username is foobar the commit message will contain
Author: foobar <foobar@ps.uni-saarland.de>
instead of
Author: root <root@ps.uni-saarland.de>
Using the etckeeper command will also keep empty directories by inserting a dummy file.
What to do if you don't want a file to be version controlled
If it doesn't make sense to put a certain file under version control (e.g. /etc/mtab) you can put its name in /etc/.gitignore
How to prevent sensitive information from being sent by email
If you have a file with sensitive information in it (e.g. passwords) you can add a line filename -diff to /etc/.gitattributes to prevent git from creating a diff of this file. Also, the git notification emails will blank out each line containing the word "password". This hack works well for most configuration files. (see /etc/.git/hooks/post-commit for the code). You can also disable the notification email hook temporarily (see Notification Emails)
Notification Emails
On each commit an email is sent to sysads@ps.uni-saarland.de containing the diffs of the commit (essentially the output of git format-patch, slightly reformatted to be more readable). In this email sensitive information is already blacked out (see How to prevent sensitive information from being sent by email). The email is sent by the post-commit hook in the /etc git (/etc/.git/hooks/post-commit). To disable the notifications you can just rename the hook to /etc/.git/hooks/post-commit.sample. This is useful if e.g. a debian install script automatically writes a password to a configuration file. Since aptitude automatically commits after an aptitude run there is no time to check whether all passwords are sufficiently protected)
Notes on version history
All changes before 2012-03-01 15:00 are only available through a svk repostitory. See svk help for additional information.
For Reference
git post-commit hook
# send commit summary to root after each commit
keyword='password'
replacement='XXX line removed for security reasons XXX'
git format-patch --subject-prefix="etckeeper@$(hostname)" --to=root --stdout \
--no-prefix --no-binary HEAD~ |
sed 1d |
sed "/^Subject:/b;
/${keyword}/c${replacement}" |
# insert 2 blank lines when a new file starts (this seems quite ugly to me,
# I'll change that if I find a better way
sed "/diff --git/i
" | sed "/diff --git/i
" | sendmail -t