-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathluagit.tex
More file actions
96 lines (78 loc) · 3.49 KB
/
luagit.tex
File metadata and controls
96 lines (78 loc) · 3.49 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
\documentclass[a4paper]{article}
% All you need to use is this one line, then it populates all the \git.. variables.
% If you want to use it for headers/footers, it needs to go before them.
\usepackage{luagit}
% Example footer with repo status in it
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\LaTeX\ and git}
\fancyhead[L]{}
\fancyfoot[L]{\tiny\ifingit\gitbranch:\gitcommithash\\
\gitcommitauthorname\ $<$\gitcommitauthoremail$>$\\
\gitcommitauthordate\ifchangedsincegitcommit [DRAFT]\fi\else (Not in git)\fi}
\fancyfoot[R]{\thepage}
\usepackage{longtable}
\usepackage{colortbl}
\title{Reading status of \LaTeX\ source repository into document}
\author{Earthspike}
\date{18 Feb 18}
\begin{document}
\begin{titlepage}
\maketitle
\end{titlepage}
\section{Reading status of \LaTeX\ source repository into document}
This document demonstrates how to read the status of the git repo in
which the document's source sits. More variables are documented in the
\verb|luagit.sty| file.
\arrayrulecolor[rgb]{.7,.7,1}
\parindent0pt{\small
\begin{longtable}[H]{p{0.5\textwidth}p{0.5\textwidth}}
\noalign{\global\arrayrulewidth=2pt}\hline
\noalign{\global\arrayrulewidth=1pt}Macro & Expansion for this file \\\hline
\endhead
\verb|\ifingit|&\ifingit true\else false\fi \\
\verb|\gitbranch|&\gitbranch \\
\verb|\gitcommithash|&\gitcommithash \\
\verb|\gitcommithashshort|&\gitcommithashshort \\
\verb|\gitcommittreehash|&\gitcommittreehash \\
\verb|\gitcommittreehashshort|&\gitcommittreehashshort \\
\verb|\gitcommitparenthashes|&\gitcommitparenthashes \\
\verb|\gitcommitparenthashesshort|&\gitcommitparenthashesshort \\
\verb|\gitcommitauthorname|&\gitcommitauthorname \\
\verb|\gitcommitauthornamemapped|&\gitcommitauthornamemapped \\
\verb|\gitcommitauthoremail|&\gitcommitauthoremail \\
\verb|\gitcommitauthoremailmapped|&\gitcommitauthoremailmapped \\
\verb|\gitcommitauthordate|&\gitcommitauthordate \\
\verb|\gitcommitcommittername|&\gitcommitcommittername \\
\verb|\gitcommitcomitternamemapped|&\gitcommitcomitternamemapped \\
\verb|\gitcommitcommitteremail|&\gitcommitcommitteremail \\
\verb|\gitcommitcommitteremailmapped|&\gitcommitcommitteremailmapped \\
\verb|\gitcommitcommitterdate|&\gitcommitcommitterdate \\
\verb|\gitcommitrefnames|&\gitcommitrefnames \\
\verb|\gitcommitencoding|&\gitcommitencoding \\
\verb|\gitcommitsubject|&\gitcommitsubject \\
\verb|\gitcommitsubjectsanitised|&\gitcommitsubjectsanitised \\
\verb|\gitcommitbody|&\gitcommitbody \\
\verb|\gitcommitbodyraw|&\gitcommitbodyraw \\
\verb|\gitcommitnotes|&\gitcommitnotes \\
\verb|\gitcommitsignaturestatus|&\gitcommitsignaturestatus \\
\verb|\gitcommitsigner|&\gitcommitsigner \\
\verb|\gitcommitkey|&\gitcommitkey \\
\verb|\gitcommitreflogselector|&\gitcommitreflogselector \\
\verb|\gitcommitreflogselectorshort|&\gitcommitreflogselectorshort \\
\verb|\gitcommitreflogidentityname|&\gitcommitreflogidentityname \\
\verb|\gitcommitreflogidentitynamemapped|&\gitcommitreflogidentitynamemapped \\
\verb|\gitcommitreflogidentityemail|&\gitcommitreflogidentityemail \\
\verb|\gitcommitreflogidentityemailmapped|&\gitcommitreflogidentityemailmapped \\
\verb|\gitcommitreflogsubject|&\gitcommitreflogsubject \\
\verb|\ifchangedsincegitcommit|&\ifchangedsincegitcommit true\else false\fi \\
\noalign{\global\arrayrulewidth=2pt}\hline
\end{longtable}
}
See \verb|https://github.com/earthspike/luatex-git| for more details/latest version.
\section{Roadmap}
\begin{enumerate}
\item Read which tags are pointing to the current commit
\end{enumerate}
\end{document}