build.sh: Set git-describe length

Specify `abbrev` to ensure the length of the commit hash is always the
same, in case `core.abbrev` is set or the default changes.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2022-01-18 09:55:52 -07:00
committed by Jeremy Soller
parent 417e5898da
commit 239e2cbaed

View File

@@ -20,7 +20,7 @@ fi
MODEL_DIR="$(realpath "models/${MODEL}")"
DATE="$(git show --format="%cd" --date="format:%Y-%m-%d" --no-patch)"
REV="$(git describe --always --dirty)"
REV="$(git describe --always --dirty --abbrev=7)"
VERSION="${DATE}_${REV}"
echo "Building '${VERSION}' for '${MODEL}'"