From 1a9f20d44a3c88882e5744d6179926f3f179cc8d Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 11 Apr 2023 12:31:54 -0400 Subject: vcs_tag: Add --always to git describe This fallbacks to short commit id in case the git repository does not contain any annotated tag, for example before the first release of a project. --- mesonbuild/utils/universal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild') diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py index 956b150..79c60c4 100644 --- a/mesonbuild/utils/universal.py +++ b/mesonbuild/utils/universal.py @@ -754,7 +754,7 @@ def detect_vcs(source_dir: T.Union[str, Path]) -> T.Optional[T.Dict[str, str]]: 'name': 'git', 'cmd': 'git', 'repo_dir': '.git', - 'get_rev': 'git describe --dirty=+', + 'get_rev': 'git describe --dirty=+ --always', 'rev_regex': '(.*)', 'dep': '.git/logs/HEAD' }, -- cgit v1.1