-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.gitlog
More file actions
53 lines (43 loc) · 1.57 KB
/
.gitlog
File metadata and controls
53 lines (43 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
```{=latex}
\footnotesize
\renewcommand{\arraystretch}{0.95}
\rowcolors{2}{gray!15}{white}
ifdef(«GITLOG_FILENAME»,
«define(«GITLOG_CMD», «git log --date=short --pretty=format:"%ad|%s|%an|%h" -- "»GITLOG_FILENAME«"»)»,
«define(«GITLOG_CMD», «git log --date=short --pretty=format:"%ad|%s|%an|%h"»)»)dnl
\begin{longtable}{|p{2.5cm}|p{7.5cm}|p{3cm}|p{2cm}|}
\hline
\rowcolor{gray!40}
\textbf{Date} & \textbf{Message} & \textbf{Author} & \textbf{Hash} \\
\hline
\endfirsthead
\hline
\rowcolor{gray!40}
\textbf{Date} & \textbf{Message} & \textbf{Author} & \textbf{Hash} \\
\hline
\endhead
\hline
\endfoot
esyscmd(«»GITLOG_CMD« | awk -F '|' '{
# Escape advanced characters using LaTeX commands
gsub(/\\/, "\\textbackslash ", $2); # \ → \textbackslash
gsub(/</, "\\textless ", $2); # < → \textless
gsub(/>/, "\\textgreater ", $2); # > → \textgreater
gsub(/\|/, "\\textbar ", $2); # | → \textbar
gsub(/~/, "\\textasciitilde ", $2); # ~ → \textasciitilde
gsub(/\^/, "\\textasciicircum ", $2); # ^ → \textasciicircum
gsub(/&/, "\\\\&", $2);
gsub(/_/, "\\_", $2);
gsub(/#/, "\\#", $2);
gsub(/\$/, "\\$", $2);
gsub(/%/, "\\%", $2);
gsub(/{/, "\\{", $2);
gsub(/}/, "\\}", $2);
split($3, n, " ");
printf "\\hline %s & %s & %s.%s & %s \\\\\n", $1, $2, substr(n[1],1,1), n[length(n)], $4}'»)dnl
undefine(«GITLOG_CMD»)dnl
undefine(«GITLOG_FILENAME»)dnl
\hline
\end{longtable}
\newpage
```