python / python/cpython

patchcheck does not recognise the upstream remote in a partial clone (git remote -v appends "[blob:none]")

Aberta
#156,064 3 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

infra type-bug
Linguagem predominante
Python
Estrelas
77.2k
Forks
36k
Métricas de merge de PRs
Métricas de PR pendentes

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece em Tools/patchcheck/patchcheck.py, em get_git_upstream_remote(), e examine como a saída de git remote -v é filtrada. Reproduza com um partial clone usando --filter=blob:none e verifique se o remote de fetch upstream é detectado e incluído na saída de erro quando apropriado. Está concluído quando patchcheck reconhecer o remote upstream apesar do texto anexado [blob:none]; o PR vinculado gh-156065 já está presente.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
git, python
Domínio
tooling
Tipo de issue
Bug
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.