SERVER-127470: Use git hash prefix instead of suffix in version strings (#54377)

GitOrigin-RevId: 8816fa3cf7191208a5c1923922d8e7f174b84a19
This commit is contained in:
Zack Winter 2026-05-26 09:11:38 -07:00 committed by MongoDB Bot
parent c0bc268ebc
commit c5ff683b5b
3 changed files with 5 additions and 5 deletions

View File

@ -25,10 +25,10 @@ if [ "${is_patch}" = "true" ]; then
MONGO_VERSION="$MONGO_VERSION-patch-${version_id}"
fi
# For commit builds, append the last 8 characters of the git revision to the version string.
# For commit builds, append the first 8 characters of the git revision to the version string.
if [[ "${requester}" == "commit" ]]; then
GIT_REV=$(git rev-parse HEAD)
MONGO_VERSION="${MONGO_VERSION}-${GIT_REV: -8}"
MONGO_VERSION="${MONGO_VERSION}-${GIT_REV:0:8}"
fi
# Forcefully override the version for purposes of testing against a different version than the

View File

@ -41,7 +41,7 @@ if [[ "${requester}" == "commit" ]]; then
echo "Unable to extract MONGO_VERSION from .bazelrc.target_mongo_version" >&2
exit 1
fi
echo "common --define MONGO_VERSION=${mongo_version}-${GIT_REV: -8}" >>.bazelrc.git
echo "common --define MONGO_VERSION=${mongo_version}-${GIT_REV:0:8}" >>.bazelrc.git
fi
if [[ "${evergreen_remote_exec}" != "on" ]]; then

View File

@ -11,10 +11,10 @@ if [[ -z "${target_mongo_version}" ]]; then
fi
version="r${target_mongo_version}"
# For commit builds, append the last 8 characters of the git revision to the version string.
# For commit builds, append the first 8 characters of the git revision to the version string.
if [[ "${requester:-}" == "commit" ]]; then
GIT_REV=$(git rev-parse HEAD)
version="${version}-${GIT_REV: -8}"
version="${version}-${GIT_REV:0:8}"
fi
if [ ${IS_RELEASE} = 'true' ]; then