Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions etc/calc_release_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,14 @@ def iter_tag_lines():
the second is a tag that is associated with that commit. Duplicate commits
are possible.
"""
output = check_output(['git', 'for-each-ref', '--format=%(*objectname)|%(objectname)|%(refname:strip=2)', 'refs/tags/*'])
output = check_output(['git', 'for-each-ref', '--format=%(*objectname)|%(objectname)|%(refname)', 'refs/tags/*'])
lines = output.splitlines()
for l in lines:
obj, tagobj, tag = l.split('|', 2)
obj, tagobj, rawtag = l.split('|', 2)

# Support Git 1.x which does not have `%(refname:lstrip=2)`.
tag = str('/').join(rawtag.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):
Expand Down