Skip to content

Conversation

@eramongodb
Copy link
Contributor

@eramongodb eramongodb commented Apr 22, 2025

Followup to #1384.

due to the available git version (2.43.6)

This was incorrect: RHEL 7.6 distros apparently may contain Git versions as old as 1.8.3 (?!), not just 2.43.6. Although for-each-ref, --format, and %(refname) are supported, :strip=2 is not (requires Git 2.7+):

fatal: unknown refname: format strip=2
Traceback (most recent call last):
  File "etc/calc_release_version.py", line 372, in <module>
    RELEASE_VER = main()
                  ^^^^^^
  File "etc/calc_release_version.py", line 346, in main
    branch_tags = get_branch_tags(active_branch_name)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "etc/calc_release_version.py", line 236, in get_branch_tags
    tags_by_obj = get_object_tags()
                  ^^^^^^^^^^^^^^^^^
  File "etc/calc_release_version.py", line 269, in get_object_tags
    for obj, tagobj, tag in iter_tag_lines():
  File "etc/calc_release_version.py", line 253, in iter_tag_lines
    output = check_output(['git', 'for-each-ref', '--format=%(*objectname)|%(objectname)|%(refname:strip=2)', 'refs/tags/*'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "etc/calc_release_version.py", line 131, in check_output
    raise subprocess.CalledProcessError(ret, args[0])
subprocess.CalledProcessError: Command 'git' returned non-zero exit status 128.

Therefore, the strip operation is moved into Python with str.split('/') to drop the refs/tags/ prefix.

@eramongodb eramongodb requested a review from kevinAlbs April 22, 2025 16:42
@eramongodb eramongodb self-assigned this Apr 22, 2025
@eramongodb eramongodb requested a review from a team as a code owner April 22, 2025 16:42
@eramongodb eramongodb merged commit eec6bd4 into mongodb:master Apr 22, 2025
18 of 21 checks passed
@eramongodb eramongodb deleted the cxx-3099 branch April 22, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants