Skip to content

Conversation

@hugovk
Copy link
Member

@hugovk hugovk commented Dec 2, 2025

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