]> git.somenet.org - pub/jan/digfor.git/blob - report2/gitinfohook.sh
report for lab2
[pub/jan/digfor.git] / report2 / gitinfohook.sh
1 #!/bin/sh
2 # Copyright 2011 Brent Longborough
3 # Please read gitinfo.pdf for licencing and other details
4 # -----------------------------------------------------
5 # cp gitinfohook.sh .git/hooks/post-update
6 # chmod +x .git/hooks/post-update
7 #
8 #prefixes=". test docs"    # Example for multiple gitHeadInfo.tex files
9 prefixes="."              # Default --- in the working copy root
10 for pref in $prefixes
11         do
12         git log -1 --date=short \
13         --pretty=format:"\usepackage[%
14                 shash={%h},
15                 lhash={%H},
16                 authname={%an},
17                 authemail={%ae},
18                 authsdate={%ad},
19                 authidate={%ai},
20                 authudate={%at},
21                 commname={%an},
22                 commemail={%ae},
23                 commsdate={%ad},
24                 commidate={%ai},
25                 commudate={%at},
26                 refnames={%d}
27         ]{gitsetinfo}" HEAD > $pref/gitHeadInfo.gin
28         done