microsoft / microsoft/vscode-pull-request-github

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

Aperta
#2,030 0 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature-request
Lingua principale
TypeScript
Stelle
2.6k
Fork
795
Merge medio
1g 4h
PR unite (30g)
46

Descrizione

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 ?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal flusso di Checkout della scheda pull request e segui il modo in cui aggiunge il remote del contributor, lo recupera ed esegue il checkout del source branch. Confronta questo comportamento con il branch-only fetch e il detached checkout proposti nell’issue, quindi individua i test esistenti per il checkout in modalità review; il lavoro è completato quando i contributor branch non correlati non compaiono più in git branch -r e la pulizia continua a funzionare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
git, typescript
Ambito
developer-experience, tooling
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.