Skip to content

Fix patch branch comparison#314

Merged
hugovk merged 1 commit into
python:mainfrom
hugovk:fix-patch-branch-comparison
Dec 5, 2025
Merged

Fix patch branch comparison#314
hugovk merged 1 commit into
python:mainfrom
hugovk:fix-patch-branch-comparison

Conversation

@hugovk

@hugovk hugovk commented Dec 2, 2025

Copy link
Copy Markdown
Member

This came up during My First Patch Release (3.14.1):

✅  Checking Git repository is clean
It doesn't look like you're on the correct branch.
Are you sure you want to tag? (y/n) >

I was on branch-3.14.1, which was correct.

It comes from this code, which only runs for patch > 0:

    # make sure we're on the correct branch
    if tag.patch > 0:
        if (
            get_output(["git", "name-rev", "--name-only", "HEAD"]).strip().decode()
            != tag.basic_version
        ):
            print("It doesn't look like you're on the correct branch.")

No, they don't match, because tag.basic_version is 3.14 but git name-rev --name-only HEAD is branch-3.14.1 because the script has just created that branch.

So change it to compare the branch name with f"branch-{tag}" (branch-3.14.1) instead.

@hugovk hugovk added the bug label Dec 2, 2025
@hugovk
hugovk merged commit ed70a41 into python:main Dec 5, 2025
19 of 20 checks passed
@hugovk
hugovk deleted the fix-patch-branch-comparison branch December 5, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant