From 453919bbc7da5b1356c0531c430bb46e407a3e0e Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 24 Oct 2019 14:02:59 -0700 Subject: [PATCH] version: Only let `git describe` match tags beginning with a digit. This will let us use other tags for things like `@zulip/shared` versions. Signed-off-by: Anders Kaseorg --- tools/cache-zulip-git-version | 2 +- zerver/logging_handlers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cache-zulip-git-version b/tools/cache-zulip-git-version index 40bfbef314761..82113f586aa8c 100755 --- a/tools/cache-zulip-git-version +++ b/tools/cache-zulip-git-version @@ -2,4 +2,4 @@ set -e cd "$(dirname "$0")/.." -git describe --tags > zulip-git-version || true +git describe --tags --match='[0-9]*' > zulip-git-version || true diff --git a/zerver/logging_handlers.py b/zerver/logging_handlers.py index 7ab7144313bd6..d1d522949f264 100644 --- a/zerver/logging_handlers.py +++ b/zerver/logging_handlers.py @@ -18,7 +18,7 @@ def try_git_describe() -> Optional[str]: try: # nocoverage return subprocess.check_output( - ['git', 'describe', '--tags', '--always', '--dirty', '--long'], + ['git', 'describe', '--tags', '--match=[0-9]*', '--always', '--dirty', '--long'], stderr=subprocess.PIPE, cwd=os.path.join(os.path.dirname(__file__), '..'), ).strip().decode('utf-8')