aboutsummaryrefslogtreecommitdiffstats
path: root/gitconfig.sh
blob: 00f24f4b8ae4129a3d27d70977aeba6a42517ab6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
#
# This script configures a git repository to support pwman database diff-ing.
#

set -e

if ! [ -d .git ]; then
	echo "ERROR: The current directory is not a git repository." >&2
	exit 1
fi

git config --replace-all diff.pwman.textconv "pwman -c \"dbdump -h\""

if ! [ -e .gitattributes ] ||\
   ! grep -q 'diff=pwman' .gitattributes; then
	echo "*.db diff=pwman" >> .gitattributes
fi

exit 0
bues.ch cgit interface