mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
py/makeversionhdr.py: Always abbreviate Git hashes to same length.
The Git hash is embedded in the version number. The hash is abbreviated by Git. This commit changes the length of the Git hash abbreviation to a fixed number, so that the length of the version string no longer varies based on external factors (it can still vary, but will now be at least 10 characters). This change is made because builds of the same MicroPython commit on multiple machines were sometimes giving a version string with different lengths, eg due to commits on other local branches having a clashing abbreviated hash. This change may also help the code size report to be more consistent, because it will less often be impacted by random changes in the version string length, at the cost of always being a few bytes longer. Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
This commit is contained in:
committed by
Damien George
parent
1aaf6eddd8
commit
9e89c752cb
@@ -31,7 +31,16 @@ def get_version_info_from_git(repo_path):
|
||||
# Note: git describe doesn't work if no tag is available
|
||||
try:
|
||||
git_tag = subprocess.check_output(
|
||||
["git", "describe", "--tags", "--dirty", "--always", "--match", "v[1-9].*"],
|
||||
[
|
||||
"git",
|
||||
"describe",
|
||||
"--tags",
|
||||
"--dirty",
|
||||
"--always",
|
||||
"--match",
|
||||
"v[1-9].*",
|
||||
"--abbrev=10",
|
||||
],
|
||||
cwd=repo_path,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
|
||||
Reference in New Issue
Block a user