| 1 |
#!/bin/sh |
| 2 |
# Copyright 2015 Brent Longborough |
| 3 |
# Part of gitinfo2 package Version 2 |
| 4 |
# Release 2.0.7 2015-11-22 |
| 5 |
# Please read gitinfo2.pdf for licencing and other details |
| 6 |
# ----------------------------------------------------- |
| 7 |
# Post-{commit,checkout,merge} hook for the gitinfo2 package |
| 8 |
# |
| 9 |
# Get the first tag found in the history from the current HEAD |
| 10 |
FIRSTTAG=$(git describe --tags --always --dirty='-*' 2>/dev/null) |
| 11 |
# Get the first tag in history that looks like a Release |
| 12 |
RELTAG=$(git describe --tags --long --always --dirty='-*' --match '[0-9]*.*' 2>/dev/null) |
| 13 |
# Hoover up the metadata |
| 14 |
git --no-pager log -1 --date=short --decorate=short \ |
| 15 |
--pretty=format:"\usepackage[% |
| 16 |
shash={%h}, |
| 17 |
lhash={%H}, |
| 18 |
authname={%an}, |
| 19 |
authemail={%ae}, |
| 20 |
authsdate={%ad}, |
| 21 |
authidate={%ai}, |
| 22 |
authudate={%at}, |
| 23 |
commname={%cn}, |
| 24 |
commemail={%ce}, |
| 25 |
commsdate={%cd}, |
| 26 |
commidate={%ci}, |
| 27 |
commudate={%ct}, |
| 28 |
refnames={%d}, |
| 29 |
firsttagdescribe={$FIRSTTAG}, |
| 30 |
reltag={$RELTAG} |
| 31 |
]{gitexinfo}" HEAD > .git/gitHeadInfo.gin |