build-release-tarball: Override merge-base for full official releases.

This commit is contained in:
Alex Vandiver
2022-11-15 10:31:43 -05:00
committed by Tim Abbott
parent e95e8b985f
commit 1f1e1e4ec2
3 changed files with 15 additions and 15 deletions

View File

@@ -5,9 +5,13 @@ cd "$(dirname "$0")/.."
remote="$(git config zulip.zulipRemote)" || remote=upstream
{
git describe --always --tags --match='[0-9]*'
branches="$(git for-each-ref --format='%(objectname)' "refs/remotes/$remote/main" "refs/remotes/$remote/*.x" "refs/remotes/$remote/*-branch")"
mapfile -t branches <<<"$branches"
if merge_base="$(git merge-base -- HEAD "${branches[@]}")"; then
git describe --always --tags --match='[0-9]*' -- "$merge_base"
if [ -z "${OVERRIDE_MERGE_BASE+x}" ]; then
branches="$(git for-each-ref --format='%(objectname)' "refs/remotes/$remote/main" "refs/remotes/$remote/*.x" "refs/remotes/$remote/*-branch")"
mapfile -t branches <<<"$branches"
if merge_base="$(git merge-base -- HEAD "${branches[@]}")"; then
git describe --always --tags --match='[0-9]*' -- "$merge_base"
fi
else
echo "$OVERRIDE_MERGE_BASE"
fi
} >zulip-git-version