microsoft / microsoft/vscode-pull-request-github
Don't fetch every branch in contributor's remote when checking out a pull request
Nadie ha tomado este issue todavía.
- 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:
- 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")
- This new remote is fetched (this creates remote-tracking branches for all branches in the contributor's remote)
- 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- 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