]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson-vcs-tag: add work-around for git bug
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 19 Dec 2018 12:25:07 +0000 (13:25 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 21 Dec 2018 12:43:20 +0000 (13:43 +0100)
meson.build
tools/meson-vcs-tag.sh

index 100265570d53dbcf576befeb5f6cb4b0d8fa231f..e3641e088c002e36e1bfdda357786f1ffc2f528b 100644 (file)
@@ -584,7 +584,7 @@ endif
 #####################################################################
 
 vcs_tagger = [meson.source_root() + '/tools/meson-vcs-tag.sh',
-              '@0@/.git'.format(meson.source_root()),
+              meson.source_root(),
               meson.project_version()]
 
 sed = find_program('sed')
index 9b024c8c2888ed661fa3925979b8cfb849aec310..4345c2145a38b4bc1edd27d415c452ecedb0114a 100755 (executable)
@@ -3,7 +3,10 @@
 set -eu
 set -o pipefail
 
-gitdir="$1"
+dir="$1"
 fallback="$2"
 
-git --git-dir="$gitdir" describe --abbrev=7 --dirty=+ 2>/dev/null | sed 's/^v//' || echo "$fallback"
+# Apparently git describe has a bug where it always considers the work-tree
+# dirty when invoked with --git-dir (even though 'git status' is happy). Work
+# around this issue by cd-ing to the source directory.
+cd "$dir" && git describe --abbrev=7 --dirty=+ 2>/dev/null | sed 's/^v//' || echo "$fallback"