Skip to content

Commit

Permalink
Fix: increase SHA-1 short version length (#1092)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mem authored Dec 10, 2024
1 parent 90ec9d0 commit a09f85d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/version
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a09f85d

Please sign in to comment.