diff --git a/etc/calc_release_version.py b/etc/calc_release_version.py index da8b5925c8..d5a785b299 100644 --- a/etc/calc_release_version.py +++ b/etc/calc_release_version.py @@ -250,10 +250,12 @@ def iter_tag_lines(): the second is a tag that is associated with that commit. Duplicate commits are possible. """ - output = check_output(['git', 'tag', '--list', '--format=%(*objectname)|%(objectname)|%(refname:strip=2)']) + output = check_output(['git', 'for-each-ref', '--format=%(*objectname)|%(objectname)|%(refname:strip=2)', 'refs/tags/*']) lines = output.splitlines() for l in lines: obj, tagobj, tag = l.split('|', 2) + if not tag.startswith('r'): + continue # We only care about "rX.Y.Z" release tags. if re.match(r'r\d+\.\d+', tag): yield obj, tagobj, tag diff --git a/etc/calc_release_version_selftest.sh b/etc/calc_release_version_selftest.sh index a59e5399f2..57df818ef7 100755 --- a/etc/calc_release_version_selftest.sh +++ b/etc/calc_release_version_selftest.sh @@ -67,7 +67,7 @@ echo "Test next minor version ... begin" # failed, then it is probably because a new major/minor release was made. # Update the expected output to represent the correct next version. # XXX NOTE XXX NOTE XXX - assert_eq "$got" "3.10.0-$DATE+git$CURRENT_SHORTREF" + assert_eq "$got" "4.1.0-$DATE+git$CURRENT_SHORTREF" } echo "Test next minor version ... end"