abhinav / abhinav/git-spice

Better workflow for renaming remote branches

Aperta
#655 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Go
Stelle
763
Fork
72
Merge medio
18h 24m
PR unite (30g)
28

Descrizione

gs branch rename only renames the local branch, and leaves the remote alone.
AFAIK there's no way to rename the remote ref without deleting and re-pushing.

Right now, if a user wants to rename the local branch and the remote, the workflow is:

```
git push --delete origin $oldName
gs branch untrack
gs branch track
gs branch submit
```

Without the `untrack`/`track`, the git-spice state will still remember `$oldName` as the remote name for the branch and attempt to push to it.
This behavior was intentional, so as not to accidentally disconnect from PRs after pushing a branch.
However, as evident above, this makes the case where the user _does_ want to rename the branch (maybe because they haven't created a PR) annoying.

Some options:

- in `gs branch rename`, if the branch doesn't have a PR associated, offer to rename the remote
- if we can determine in `gs branch submit` that the remote ref was deleted (maybe since we use `--force-with-lease`), use that knowledge to offer to use the new remote name

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Look at the `gs branch rename` command implementation to understand how it currently renames only the local branch. Examine the logic for tracking remote branches and PR association. The goal is to modify this command to optionally rename the remote branch when no PR exists, or adjust `gs branch submit` to detect a deleted remote ref. Start by running existing tests related to branch operations.

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

Valutazione

Stack tecnologico
git, go
Ambito
cli, developer-experience
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.