Add a way to sync a stack from the remote without pushing
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Start with the existing gh stack sync command and trace how it fetches, rebases, and pushes stack branches. Compare that flow with the documented git fetch --all --prune and branch-reset sequence. Done means a sync mode or command updates local stack branches from their remotes without rebasing, pushing, or creating duplicate commits.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
When a stack has been restacked and force-pushed from elsewhere either by a collaborator, or the rebase option on gh webapp my local branches are left with the pre-rebase SHAs. With stack view every branch shows as ahead N, behind N against its remote, but the "ahead" commits are just stale copies of work that's already upstream under different hashes.
What I want in that situation is "make my local stack match the remote". as far as I am aware gh stack sync is close to doing this, but it always pushes (--force-with-lease --atomic), which is the opposite direction, and there's no flag to stop it.
It also doesn't just no-op, it rebases those stale local commits onto the updated parents, which replays commits that are already upstream. I ended up with empty duplicate commits on a branch that way, including one that kept its original co-authors on a no-op.
So what I end up doing when I want my local to match the remote stack is:
git fetch --all --prune
for every stack branch git branch -f "$branch" "origin/$b"
I think a good solution would be either a flag on sync (--no-push, or a --reset/--from-remote mode) or a separate
command, that fetches and points each local stack branch at its remote without rebasing or pushing anything. You could even have sync detect this case where local is ahead only by commits whose patch-id already exists upstream rather than directly with a flag.
- Lenguaje dominante
- Go
- Estrellas
- 1.5k
- Forks
- 73
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 7
Guía de contribución
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.
Más de github/gh-stack
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
-
feature request topic: cli - general
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
feature request topic: auto-merge
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
bug topic: docs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Todos los issues de github/gh-stack
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
NVIDIA/gpu-operator#2955 ·
-
agentic-workflows
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Broadcast Documentation Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
kovidgoyal/kitty#10516 ·
-
CVE-2024-24786 CPE mismatch Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
cisagov/vulnrichment#337 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100