Skip to content

gh-156064: Make patchcheck find the upstream remote in a partial clone - #156065

Open
ekanshul wants to merge 2 commits into
python:mainfrom
ekanshul:fix-patchcheck-partial-clone
Open

gh-156064: Make patchcheck find the upstream remote in a partial clone#156065
ekanshul wants to merge 2 commits into
python:mainfrom
ekanshul:fix-patchcheck-partial-clone

Conversation

@ekanshul

Copy link
Copy Markdown

Since Git 2.37 (git/git@ef6d15ca53), git remote -v appends the object filter of a promisor remote to its fetch line:

upstream	https://github.com/python/cpython.git (fetch) [blob:none]

get_git_upstream_remote() kept fetch lines with remote.endswith("(fetch)"), so in a partial clone the upstream remote was neither considered nor listed in the "Remotes found" part of the error, and make patchcheck failed with a misleading message. This matches "(fetch)" anywhere on the line instead and reuses the same filtered list for the error message.

Verified in a --filter=blob:none clone with origin (fork) and upstream (python/cpython) remotes: make patchcheck now reports Getting base branch for PR ... upstream/main instead of raising.

No NEWS entry, as for #135806 (developer tooling).

…l clone

Since Git 2.37, ``git remote -v`` appends the object filter of a promisor
remote to its fetch line (``... (fetch) [blob:none]``), so matching
``(fetch)`` at the end of the line missed the upstream remote of a partial
clone, and also left it out of the "Remotes found" list in the error.
@python-cla-bot

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

@bedevere-app

bedevere-app Bot commented Aug 19, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant