From The Compiler, 6 Years ago, written in Bash.
Embed
  1. #!/bin/bash
  2. if [[ $1 == --full ]]; then
  3.     echo '\documentclass[12pt,oneside,a4paper]{scrartcl}'
  4.     echo '\usepackage[english]{babel}'
  5.     #echo '\usepackage[utf8]{inputenc}'
  6.     echo '\usepackage[T1]{fontenc}'
  7.     echo '\usepackage{cmbright}'
  8.     echo '\begin{document}'
  9. fi
  10.  
  11. echo '\begin{tabular}{lll}'
  12. echo '\textbf{Commit ID} & \textbf{Date} & \textbf{Commit message} \\'
  13. echo '\hline'
  14. git log --format='format:%h %ad %s' --date=short | while read hash time msg; do
  15.     for c in '\' '%' '$' '{' '_' '#' '^' '&' '}'; do
  16.         msg=${msg//$c/\\$c}
  17.     done
  18.     echo "  \\textbf{$hash} & \\emph{$time} & $msg \\\\"
  19. done
  20. echo '\end{tabular}'
  21.  
  22. if [[ $1 == --full ]]; then
  23.    echo '\end{document}'
  24. fi