2018-03-28 13:48:20 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# Copyright 2015 Brent Longborough
|
|
|
|
# Part of gitinfo2 package Version 2
|
|
|
|
# Release 2.0.7 2015-11-22
|
|
|
|
# Please read gitinfo2.pdf for licencing and other details
|
|
|
|
# -----------------------------------------------------
|
|
|
|
# Post-{commit,checkout,merge} hook for the gitinfo2 package
|
|
|
|
#
|
|
|
|
# Get the first tag found in the history from the current HEAD
|
|
|
|
FIRSTTAG=$(git describe --tags --always --dirty='-*' 2>/dev/null)
|
|
|
|
# Get the first tag in history that looks like a Release
|
|
|
|
RELTAG=$(git describe --tags --long --always --dirty='-*' --match '[0-9]*.*' 2>/dev/null)
|
2021-07-06 17:36:07 +02:00
|
|
|
# Get toplevel directory
|
|
|
|
GITDIR=$(git rev-parse --show-toplevel)
|
|
|
|
|
2018-03-28 13:48:20 +02:00
|
|
|
# Hoover up the metadata
|
|
|
|
git --no-pager log -1 --date=short --decorate=short \
|
|
|
|
--pretty=format:"\usepackage[%
|
|
|
|
shash={%h},
|
|
|
|
lhash={%H},
|
|
|
|
authname={%an},
|
|
|
|
authemail={%ae},
|
|
|
|
authsdate={%ad},
|
|
|
|
authidate={%ai},
|
|
|
|
authudate={%at},
|
|
|
|
commname={%cn},
|
|
|
|
commemail={%ce},
|
|
|
|
commsdate={%cd},
|
|
|
|
commidate={%ci},
|
|
|
|
commudate={%ct},
|
|
|
|
refnames={%d},
|
|
|
|
firsttagdescribe={$FIRSTTAG},
|
|
|
|
reltag={$RELTAG}
|
2021-07-06 17:36:07 +02:00
|
|
|
]{gitexinfo}" HEAD > ${GITDIR}/.git/gitHeadInfo.gin
|