From a09f85dfc588f674d1fbe1bd0706fc218965d05a Mon Sep 17 00:00:00 2001 From: Marcelo Magallon Date: Tue, 10 Dec 2024 08:57:49 -0600 Subject: [PATCH] Fix: increase SHA-1 short version length (#1092) It's been observed that two different runs of git produce two different values of the short SHA-1 value (which is weird, because this is supposed to be based on the number of objects in the repository). Fix this at 12, because that is longer than what git automatically decides to use. Signed-off-by: Marcelo E. Magallon --- scripts/version | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/version b/scripts/version index b559274a..4f17d623 100755 --- a/scripts/version +++ b/scripts/version @@ -1,3 +1,9 @@ #!/bin/sh - -git describe --dirty --tags --long --always +# +# --abbrev=12 asks for at least 12 characters in the SHA-1 hash. The trick is +# that git might choose to output more if 10 are not enough to keep the value +# unique. +# +# This is a balance between having a predictable value and having something +# that is not too long, as this value gets displayed in a couple of places. +git describe --dirty --tags --long --always --abbrev=12