It'd be really nice to do a
git commit -m "some stupid broken commit" and get back a refusal from git, because the latest version of the document hasn't been successfully compiled yet (ie. changes haven't been tested). The git side of this is pretty simple, just a shell script that returns a non-zero exit code. But in order to do that, I need to be able to check whether the pdf is up to date. Apparently it can be done, since if I run
latexmk after a successful compile, I get:
$ latexmk -pdf -f thesis Latexmk: This is Latexmk, John Collins, 30 March 2012, version: 4.31. **** Report bugs etc to John Collins <collins at phys.psu.edu>. **** Latexmk: All targets (thesis.pdf) are up-to-date
This is nice, and I could just use this in the script (assuming it spits out a usable exit code). But it'd be really nice to be able to do it without latexmk compiling the document if it ISN'T up to date.
So, how does latexmk work out that the output file is up to date? Or, is it possible to tell latexmk to not compile, and just check the compilation status?