aboutsummaryrefslogtreecommitdiff
path: root/py/makeversionhdr.py
diff options
context:
space:
mode:
authorMike Wadsten <Mike.Wadsten@digi.com>2020-09-22 11:07:20 -0500
committerDamien George <damien@micropython.org>2020-10-01 11:01:43 +1000
commitc711c0049e5f12cae048d2b0e77bc70e68804ea5 (patch)
treed5a45e92d92474eafb7f93c41a3efeeaf46f4c96 /py/makeversionhdr.py
parentee7568ca8d4f1a5d09a123cf5f7a1e430b8f4c9d (diff)
py/makeversionhdr.py: Match only git tags which look like versions.
Some downstream projects may use tags in their repositories for more than just designating MicroPython releases. In those cases, the makeversionhdr.py script would end up using a different tag than intended. So tell `git describe` to only match tags that look like a MicroPython version tag, such as `v1.12` or `v2.0`.
Diffstat (limited to 'py/makeversionhdr.py')
-rw-r--r--py/makeversionhdr.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/makeversionhdr.py b/py/makeversionhdr.py
index 567b3b832..970a86e6c 100644
--- a/py/makeversionhdr.py
+++ b/py/makeversionhdr.py
@@ -23,7 +23,7 @@ def get_version_info_from_git():
# Note: git describe doesn't work if no tag is available
try:
git_tag = subprocess.check_output(
- ["git", "describe", "--dirty", "--always"],
+ ["git", "describe", "--dirty", "--always", "--match", "v[1-9].*"],
stderr=subprocess.STDOUT,
universal_newlines=True,
).strip()