make sure that every "make pdf" re-generates the git info in the
authorAaron Kaplan <aaron@lo-res.org>
Mon, 2 Dec 2013 19:58:41 +0000 (20:58 +0100)
committerAaron Kaplan <aaron@lo-res.org>
Mon, 2 Dec 2013 19:58:41 +0000 (20:58 +0100)
pages' footer

src/.gitignore
src/Makefile
src/gitHeadInfo.gin [deleted file]
src/update-metadata-for-gitinfo [new file with mode: 0755]

index 92a2b3b..f9e52e6 100644 (file)
@@ -6,4 +6,6 @@ applied-crypto-hardening.pdf
 applied-crypto-hardening.toc
 applied-crypto-hardening.markdown
 *.gummi
+*.swp
 applied-crypto-hardening/
+gitHeadInfo.gin
index d57b3cd..ad85fb6 100644 (file)
@@ -3,6 +3,7 @@ NOW := $(shell date)
 all:   pdf html md
 
 pdf:
+       ./update-metadata-for-gitinfo
        pdflatex applied-crypto-hardening
        # no bibtex citations atm
        #bibtex applied-crypto-hardening
@@ -20,3 +21,4 @@ md:
 clean:
        rm -f applied-crypto-hardening.aux applied-crypto-hardening.bbl applied-crypto-hardening.blg applied-crypto-hardening.dvi applied-crypto-hardening.log applied-crypto-hardening.pdf applied-crypto-hardening.toc applied-crypto-hardening.markdown
        rm -rf applied-crypto-hardening/
+       rm -rf gitHeadInfo.gin
diff --git a/src/gitHeadInfo.gin b/src/gitHeadInfo.gin
deleted file mode 100644 (file)
index 24c8bae..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-\usepackage[%
-                shash={daebc60},
-                lhash={daebc6054be597efab924172e6c7afcff217efcd},
-                authname={Aaron Kaplan},
-                authemail={aaron@lo-res.org},
-                authsdate={2013-11-21},
-                authidate={2013-11-21 16:33:43 +0100},
-                authudate={1385048023},
-                commname={Aaron Kaplan},
-                commemail={aaron@lo-res.org},
-                commsdate={2013-11-21},
-                commidate={2013-11-21 16:33:43 +0100},
-                commudate={1385048023},
-                refnames={ (HEAD, origin/master, origin/HEAD, master)}
-        ]{gitsetinfo}
\ No newline at end of file
diff --git a/src/update-metadata-for-gitinfo b/src/update-metadata-for-gitinfo
new file mode 100755 (executable)
index 0000000..6260a54
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+GITINFO_INDEX_FILENAME="gitHeadInfo.gin"
+GITINFO_GIT_LOG_PRETTY_FORMAT=$(cat <<'__EOS__'
+\usepackage[%
+        shash={%h},
+        lhash={%H},
+        authname={%an},
+        authemail={%ae},
+        authsdate={%ad},
+        authidate={%ai},
+        authudate={%at},
+        commname={%an},
+        commemail={%ae},
+        commsdate={%ad},
+        commidate={%ai},
+        commudate={%at},
+        refnames={%d}
+]{gitsetinfo}
+__EOS__
+)
+git log -1 --date=short \
+               --pretty=format:"${GITINFO_GIT_LOG_PRETTY_FORMAT}" \
+               HEAD  > ./${GITINFO_INDEX_FILENAME}
+
+