I am currently using the gitinfo2
package in my document to display the current git revision, branch, and date. However, I would only like to display the branch if I am not on the master branch. This will require some conditional wrapping around \gitBranch
but I couldn't figure this out.
MWE:
\documentclass{scrbook}
\usepackage{gitinfo2}
% additional install is required. See package documentation for details.
\begin{document}
\begin{titlepage}
\centering
\ \\
\vspace{5cm}
{\Huge Document title}
\vspace{5cm}
Revision: \gitAbbrevHash on branch \gitBranch \ \gitCommitterDate
\end{titlepage}
Some text.
\end{document}
So far, I've tried this, with no success:
\documentclass{scrbook}
\usepackage{gitinfo2}
% additional install is required. See package documentation for details.
\newcommand{\masterBranch}{master}
\begin{document}
\begin{titlepage}
\centering
\ \\
\vspace{5cm}
{\Huge Document title}
\vspace{5cm}
Revision: \gitAbbrevHash
\if\gitBranch\masterBranch
\else
on branch \gitBranch
\fi
\ \gitCommitterDate
\end{titlepage}
Some text.
\end{document}