patchcheck does not recognise the upstream remote in a partial clone (git remote -v appends "[blob:none]")
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
Bug description:
make patchcheck fails to find the upstream remote in a partial clone (git clone --filter=blob:none ...), even when the remote is named upstream and points at https://github.com/python/cpython:
ValueError: Patchcheck was unable to find an unambiguous upstream remote, with URL matching 'https://github.com/python/cpython'. For help creating an upstream remote, see Dev Guide: https://devguide.python.org/getting-started/git-boot-camp/#cloning-a-forked-cpython-repository
Remotes found:
origin https://github.com/ekanshul/cpython.git (fetch)
Since Git 2.37 (git/git@ef6d15ca53), git remote -v appends the object filter of a promisor remote to its fetch line:
$ git remote -v
origin https://github.com/ekanshul/cpython.git (fetch)
origin https://github.com/ekanshul/cpython.git (push)
upstream https://github.com/python/cpython.git (fetch) [blob:none]
upstream https://github.com/python/cpython.git (push)
get_git_upstream_remote() in Tools/patchcheck/patchcheck.py (from #135806) selects fetch lines with remote.endswith("(fetch)"), so the partially-cloned upstream is dropped both from the candidates and from the "Remotes found" list in the error message, which makes the message misleading too. Matching "(fetch)" anywhere on the line fixes it.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS (git 2.50.1)
Linked PRs
- gh-156065
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Tools/patchcheck/patchcheck.py の get_git_upstream_remote() から始め、git remote -v の出力がどのようにフィルタリングされているかを調べてください。--filter=blob:none を使った partial clone で再現し、upstream の fetch remote が検出され、適切な場合にエラー出力に含まれることを確認してください。patchcheck が末尾に追加された [blob:none] というテキストがあっても upstream remote を認識できれば完了です。リンク先の PR gh-156065 はすでに存在します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- git, python
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 35/100