Added params to redirect.
[kic.git] / generate_gitinfo.sh
blob2feae744e578dc39a1341ed36d097197a3c48723
1 #!/bin/sh
2 # Copyright 2011 Brent Longborough
3 # Please read gitinfo.pdf for licencing and other details
4 # -----------------------------------------------------
5 # Post-{commit,checkout,merge} hook for the gitinfo package
7 prefixes="." # Default --- in the working copy root
8 for pref in $prefixes
9 do
10 git log -1 --date=short \
11 --pretty=format:"\usepackage[%
12 shash={%h},
13 lhash={%H},
14 authname={%an},
15 authemail={%ae},
16 authsdate={%ad},
17 authidate={%ai},
18 authudate={%at},
19 commname={%an},
20 commemail={%ae},
21 commsdate={%ad},
22 commidate={%ai},
23 commudate={%at},
24 refnames={%d}
25 ]{gitsetinfo}" HEAD > $pref/.gitHeadInfo.gin
26 done
27 if [ ! -f gitHeadInfo.gin ]; then
28 mv .gitHeadInfo.gin gitHeadInfo.gin
29 else
30 diff -q .gitHeadInfo.gin gitHeadInfo.gin
31 if [ $? = 1 ]; then
32 mv .gitHeadInfo.gin gitHeadInfo.gin
33 else
34 rm .gitHeadInfo.gin