aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoud Roukema <boud@cosmo.torun.pl>2020-08-02 00:48:06 +0100
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2020-08-02 00:51:16 +0100
commit32f3ba14f6c6efcef7edea0a365638527721f509 (patch)
treeaee0cb5067547949cae0c07319232553193ed520
parentcbd4a41555c7d4aecaea03a4cc4298da8320f01c (diff)
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.
-rw-r--r--reproduce/analysis/make/initialize.mk11
1 files 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}" >> $@