From c711c0049e5f12cae048d2b0e77bc70e68804ea5 Mon Sep 17 00:00:00 2001 From: Mike Wadsten Date: Tue, 22 Sep 2020 11:07:20 -0500 Subject: [PATCH] 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`. --- py/makeversionhdr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/makeversionhdr.py b/py/makeversionhdr.py index 567b3b8322..970a86e6ca 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()