diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-12-19 13:25:07 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-12-21 13:43:20 +0100 |
commit | e4d5753bd094cf542f54edbbd58417a5394f5384 (patch) | |
tree | 4340be32319fec9571589f14b0ec2a2395b6d7f3 /tools | |
parent | 681bd2c524ed71ac04045c90884ba8d55eee7b66 (diff) | |
download | systemd-e4d5753bd094cf542f54edbbd58417a5394f5384.tar.gz |
meson-vcs-tag: add work-around for git bug
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/meson-vcs-tag.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/meson-vcs-tag.sh b/tools/meson-vcs-tag.sh index 9b024c8c28..4345c2145a 100755 --- a/tools/meson-vcs-tag.sh +++ b/tools/meson-vcs-tag.sh @@ -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" |