intersystems / intersystems/git-source-control

feature request: help users clean up branches removed from remote

Offen
#994 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
customer
Vorherrschende Sprache
ObjectScript
Sterne
22
Forks
14
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
5

Beschreibung

If you are in the habit of checking out and running other team members branches as part of your QA workflow, then these branches can accumulate over time and can quickly clutter up the UI unless devs stay on top of deleting branches once they are done using them. Git itself offers a few ways to know when a remote tracking branch has been removed. It would be nice if Embedded git offered a way to key into this and help the user bulk remove these branches.

## Observation 1

`git fetch origin --prune` will not only update all remote tracking branches, but it will also remove any that are no longer present in the remote repo. While it will not remove any corresponding local branches, it does print out which remote branches it removed:

```shell
$ git fetch origin --prune
From github.com:user/repo
- [deleted] (none) -> origin/feature/branch
```
If any of these branches exist locally, an option could be presented to the user to remove or keep them.

## Observation 2
`git branch` offers an option which provides an indicator as to whether or not the local repo is still aware of the remote tracking branch:

```shell
$ git branch -v
feature/untracked-branch abcdef1 commit message
feature/tracked-branch 1234567 [gone] commit message
```
Every branch containing `[gone]` could be presented to the end user to decide if they want to keep or remove it.

## UI Suggestion
However Embedded Git determines that a local branch no longer has a remote partner, it could present them all in a checkbox list to the end user (similar to the list of uncommitted files, including a "Select All" option). Once the user makes their selection, they can remove them with a single button click.

(Loop through the list to `git branch -D {{branch name}}` and then run `git gc` to tidy up afterwards)

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Es werden keine Implementierungsdateien, Tests oder Einstiegspunkte genannt. Beginne damit, die bestehende UI zur Branch-Verwaltung und die Handler für git fetch oder die Auflistung von Branches zu finden. Erledigt ist die Aufgabe, wenn Branches identifiziert werden, deren Remote-Tracking-Branch nicht mehr vorhanden ist, zur Auswahl angezeigt werden, nur ausgewählte Branches entfernt werden und anschließend wie beschrieben aufgeräumt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
git
Bereich
developer-experience, tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.