microsoft / microsoft/vscode-pull-request-github
Don't fetch every branch in contributor's remote when checking out a pull request
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.6k
- Forks
- 796
- Ø Merge
- 1 T. 4 Std.
- Gemergte PRs (30 T.)
- 46
Beschreibung
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 ?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne beim Checkout-Flow des Pull-Request-Tabs und verfolge, wie er den Contributor-Remote hinzufügt, ihn abruft und den Source-Branch auscheckt. Vergleiche dieses Verhalten mit dem im Issue vorgeschlagenen Branch-only-Fetch und Detached Checkout. Ermittle anschließend vorhandene Tests für den Checkout im Review-Modus; als erledigt gilt die Aufgabe, wenn nicht zugehörige Contributor-Branches nicht mehr in git branch -r erscheinen und das Aufräumen weiterhin funktioniert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- git, typescript
- Bereich
- developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100