[Ach] git metadata for output-files

Ulrich Poeschl ulrich.poeschl at bmlvs.gv.at
Wed Nov 20 21:48:51 CET 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hey,

I read "make the git version number part of the document" within the
TODO-file, so I updated the project to use gitinfo for adding metadata
to the footer of the (pdf)-output files.

I am not quite THE git-crack, and this is just one way to do it.
Another way would possibly be via the Makefile, dunno.

If you add the script below to your .git/hooks/ as post-commit,
post-checkout and post-merge, it will do the trick.

hth, Ulrich

- -------------------------- snip --------------------------
#!/bin/sh
prefixes="src"
for pref in $prefixes
        do
        git log -1 --date=short \
        --pretty=format:"\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}" HEAD > $pref/gitHeadInfo.gin
        done
- -------------------------- snip --------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSjSAyAAoJEJKZmcxlX63XkrgP/3sWm6onlMMKDmg+moGyn2y5
2/Vq+H3WI421BKhzPtQ79tBfhzE3Pm+0In1cO7yjgBXndF6vMvRBgw7LKYenRBwE
bolTuxzMaAirD2wb8Z6CM5FE71jFKuW7Uo+JbrGMLqebgtIJbIHHSe6Fr+33nwJK
CDzIDYDK+WU3LkRvgjiEYj3043wgD57Sk6u1qK4FZui8XIc25dng5kRU1aOdaKQE
BEclgb6019gz3rEUxRoYG5IPXgO7ODcAOyyRXw8bhviUPAU0V0uQLP3bQ56pXIRP
W3YYG75NLoAA4sPDGAbocbmuepEn6UowEXyI35evEnMmTh8dOY13q2wUr6co5o0Z
xkBMFKP2G9mnJQ0vY+bK4sWhAvIcxTriG06JrD7eFfIExVb5+jG/1QuRo4vwoWD3
vbcWyDJQGgd7BOwpy88PgqNn+rgBoAZTQqmgjNjG0yr91UswM4GabOBRkKlv9o9j
s83IcqIbjNELY9P+iG1ODlR/f56zjXkKFzuzL1PquAAUY4GdMZwyXzIRlrpGtge7
TJRVGCF7Kl8+Nw8jC26p1ZhVhs49QsjXlvi4M8QKUn+dP3A63kypHqnJ3TgJndGO
osQvXjj4cWOKbYTVz2T6xz7AnjVY5S82Ei+LcSFK+zsyGpGkiRtdmDHHVQkY39bA
hU8oLZv1WUu4jyKokTlt
=ot9Q
-----END PGP SIGNATURE-----



More information about the Ach mailing list