8000 Fix version determination for 10.x · carlossless/circuitpython@5155d24 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5155d24

Browse files
committed
Fix version determination for 10.x
The old glob assumed one digit before the ".". Now pick anything that doesn't start with "v" and is on the main branch. These are always merge commits. Code merged in is on the second parent.
1 parent 61ed7c7 commit 5155d24

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

py/version.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ def get_version_info_from_git(repo_path, extra_args=[]):
99
# Note: git describe doesn't work if no tag is available
1010
try:
1111
git_tag = subprocess.check_output(
12-
# CIRCUITPY-CHANGE
12+
# CIRCUITPY-CHANGE: Ignore MicroPython tags that start with v.
13+
# Also ignore tags that are on merged in branches.
1314
[
1415
"git",
1516
"describe",
1617
"--dirty",
1718
"--tags",
1819
"--always",
20+
"--first-parent",
1921
"--match",
20-
"[1-9].*",
22+
"[!v]*", # This is a glob, not a regex
2123
*extra_args,
2224
],
2325
cwd=repo_path,

0 commit comments

Comments
 (0)
0