Skip to content

Expand release-information to include git tags#26

Merged
olehermanse merged 1 commit intocfengine:mainfrom
sarakthon:add-git-tags
Mar 16, 2026
Merged

Expand release-information to include git tags#26
olehermanse merged 1 commit intocfengine:mainfrom
sarakthon:add-git-tags

Conversation

@sarakthon
Copy link
Contributor

Ticket: ENT-13778

Comment on lines +51 to +62
for line in output.splitlines():
ref = line.split()[1]
tag = ref.split("refs/tags/")[1]
if re.fullmatch(TAG_REGEX, tag):
sha = (
subprocess.check_output(
["git", "log", "-n", "1", "--format=%H", tag], cwd=repo_path
)
.decode()
.strip()
)
tag_map[tag] = sha
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of using git show-ref --tags was to eliminate these unnecessary subprocesses, I made a mistake when showing you the command, this is the correct version of it;

git show-ref --tags -d

With that command, you get all the information you need in just 1 process instead of having to call git log again and again;

bac5b9cd69d91179eca01f2af9ebae16a4eb29d7 refs/tags/3.27.0
4c3834d679d5f03adc8a853f8481680ade44dd5a refs/tags/3.27.0^{}

The lines ending with ^{} have the correct commit SHA for that version.

@olehermanse olehermanse merged commit 0db861e into cfengine:main Mar 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants