microsoft / microsoft/vscode-pull-request-github

Don't fetch every branch in contributor's remote when checking out a pull request

Abierto
#2,030 0 comentarios 3 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

feature-request
Lenguaje dominante
TypeScript
Estrellas
2.6k
Forks
795
Merge medio
1 d 4 h
PR fusionados (30 d)
46

Descripción

Thanks for this very nice extension!! It is really nice to review code in my code editor:)

I noticed that when I clicked the blue "Checkout" button in the pull request tab, the following happens:

  1. The extension adds a remote named after the GitHub username of the pull-request author (this remote is not deleted when I "Exit review mode")
  2. This new remote is fetched (this creates remote-tracking branches for all branches in the contributor's remote)
  3. The the source branch of the pull request is checked out (this branch is not deleted when I "Exit review mode")

I don't like 2), it pollutes the output of git branch -r.
I think the extension should only fetch the branch of the pull request, i.e.

git fetch $PR_AUTHOR_REMOTE_URL $PR_BRANCH:refs/heads/pr/$AUTHOR_GITHUB_USERNAME/$PR_NUMBER

In fact, adding a remote is not even necessary as Git can fetch a branch directly into FETCH_HEAD, and we can the checkout FETCH_HEADin detached HEAD.

I understand the current behaviour might be convenient for some, but maybe it could be configurable ?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Empieza en el flujo de Checkout de la pestaña de pull requests y sigue cómo añade el remoto del contributor, lo obtiene y hace checkout de la rama de origen. Compara ese comportamiento con el fetch limitado únicamente a la rama y el checkout detached propuestos en el issue; se considera terminado cuando las ramas del contributor que no están relacionadas ya no aparecen en git branch -r y la limpieza sigue funcionando.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
git, typescript
Área
developer-experience, tooling
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.