From 32f3ba14f6c6efcef7edea0a365638527721f509 Mon Sep 17 00:00:00 2001 From: Boud Roukema Date: Sun, 2 Aug 2020 00:48:06 +0100 Subject: initialize.mk: accounting for no maneage branch One of the LaTeX macros reported by 'initialize.mk' is the git commit hash of the most recent 'maneage' branch that the project has been branched from. However, not all projects will retain the maneage reference. This can happen for example when people don't push the 'maneage' reference to their repository and then clone from their own repository to a second computer. Therefore, until now, in such situations, Maneage would break with an error. With this commit, in such scenarios, a place holder string is used instead, clearly highlighting that there is no 'maneage' reference. --- reproduce/analysis/make/initialize.mk | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk index 211c1c0..fca75f5 100644 --- a/reproduce/analysis/make/initialize.mk +++ b/reproduce/analysis/make/initialize.mk @@ -486,7 +486,12 @@ $(mtexdir)/initialize.tex: | $(mtexdir) echo "\newcommand{\projectversion}{$(project-commit-hash)}" >> $@ # Calculate the latest Maneage commit used to build this - # project. Note that the '--dirty' option isn't applicable to - # "commit-ishes" (direct quote from Git's error message!). - v=$$(git describe --always --long maneage) + # project: + # - The '--dirty' option (used in 'project-commit-hash') isn't + # applicable to "commit-ishes" (direct quote from Git's error + # message!). + # - The project may not have the 'maneage' branch (for example + # after cloning from a fork that didn't include it!). In this + # case, we'll just return the string a clear string. + v=$$(git describe --always --long maneage) || v=maneage-ref-missing echo "\newcommand{\maneageversion}{$$v}" >> $@ -- cgit v1.2.1