Lukas Fleischer e7a83118ea Do not put all files under version control in example hooks
Modify the Git hooks such they only add known data files to the index.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-07 13:38:52 +01:00

15 lines
402 B
Bash
Executable File

#!/bin/sh
#
# Copy this file into ~/.calcurse/hooks/ and mark it executable to
# automatically commit any changes to the calcurse data files using Git.
cd "$HOME"/.calcurse/
# Do not make commits when synchronizing with a CalDAV server.
[ -f caldav/lock ] && exit
git add apts conf keys todo
if ! git diff-index --quiet --cached HEAD; then
git commit -m "Automatic commit by the post-save hook"
fi