Sign up ×  Is there a way to insert the last git commit date
into a document without having to add git hooks (like the
gitinfo package does it)?  I'm not 100% sure how LaTeX packages
work, but if they can access the current directory during
compile-time and if they can execute external commands, that
should easily be possible...  share|improve this question  3
Answers 3  here is my solution: use \write18 to write a temp.dat
file which contains 2 commands:   then input that file, the
\GITxxx will get defined. We can use it anywhere, e.g. running
title.  \immediate\write18{git log -1
--pretty=format:"\@backslashchar gdef\@backslashchar
GITHash{\@percentchar h}\@percentchar n \@backslashchar
gdef\@backslashchar GITDate{\@percentchar ad}" --date=short >
/tmp/temp.dat } share|improve this answer up vote 11 down vote
accepted  I ended up using a custom Makefile to insert the
revision info.  When creating a Makefile instead of using the
--enable-write18 compiler flag, you require people to use a
specific compilation