Skip to content

Commit c711c00

Browse files
mikewadstendpgeorge
authored andcommitted
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`.
1 parent ee7568c commit c711c00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/makeversionhdr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def get_version_info_from_git():
2323
# Note: git describe doesn't work if no tag is available
2424
try:
2525
git_tag = subprocess.check_output(
26-
["git", "describe", "--dirty", "--always"],
26+
["git", "describe", "--dirty", "--always", "--match", "v[1-9].*"],
2727
stderr=subprocess.STDOUT,
2828
universal_newlines=True,
2929
).strip()

0 commit comments

Comments
 (0)