Roland's homepage

My random knot in the Web

Formatting git changelogs for LaTeX

Most of the things I write, be it software or something else, are under revision control with git. Mostly because it makes undoing mistakes easy. My LaTeX documents are no exception. With software it is customary to have a change-log (like the one generated by the git log command). I wanted to do something similar for LaTeX.

The easiest way to do that would probably be to save the git log output to a file and include that with a \verbatimfile command from the verbatimfiles package. But that would look pretty ugly.

So I decided to write a program that parses the output of the git log command and format it using a tabular environment. It is called mkhistory.py.

This is some git log output:

git log output

And this is wat it looks like after mkhistory.py has done its job and the resulting LaTeX code has been processed into a pdf:

git log output after processing with mkhistory
Source:mkhistory.py
GPG signature:
——-BEGIN PGP SIGNATURE——-
Version: GnuPG v2

iQIcBAABCAAGBQJUlJcQAAoJEED21dyjijPgDRoP/3xYjUQOl+IC/YPwDEgHpGPU
iBtIch1cvAJJ9v11/QMbowes8pYQS7PYez5n6xOfu9QIimUT8KB0sipNlamMQFk8
DAPrvSSTTKHK9br9VFYwvVRU2AEvH5CQdYTQoUXXmnOJpHCGgpfgScLzUbPFUyWn
yQPMsvZg+fL9J1X6860FJkDXXtvl4fwCx2vHSwg/F63qa4yTG1nVVh0avOk/ZNUD
HcWvVKzxkZgOxw5ZEd7wFuVKUUzNjlXoB9Q5rSEG47VKxQj+uaNcovlGhTLInA/e
6CS4VOCwThs43Xms8RGrOn7pA9dyB09YsRT96AfctdNGLBFD8ySSuLo6NYgDXHsQ
FhASiQMeWqpuMHwstTf4DO0ElIzcLlH83BZt04aagutTLNWjZE3hsERmeNTOwMKK
A5nkSVxWs0z7tu9Tzw88ExL/Ut7DZx2HN1EEeT91og9qUKa85Z0Ln7+ojIe+NlID
+RNlmpBzu4xmaVxVvGs5h82BOkvh0BS7gXCbe2JRq+IGz3INrAtHTjCsEhozzgyK
6PaAKsGA3/RTYvEcp8j4o66kziYBORXk8zK2N1ReIamN30W2GM0QOh/Izyy6hh2h
zYFokNVfg1cV6xxo+GgwscCVKOn0yu1VFnMcGljOUR/7pXs66KJEYileAObktVnF
iJgLjUXoSE6MRDlEcDJL
=xPp7
——-END PGP SIGNATURE——-
SHA256 hash:f87c98f6593cc2226bf5cc21e93087ddcf7613819ffdc77f11c23a8e8ad62b5b
Requirements:python (version 3), git

Note

creative commons public domain logo

To the extent possible under law, Roland Smith has waived all copyright and related or neighboring rights to mkhistory.py. This work is published from the Netherlands.


←  csv2tbl tifftopdf  →