github / github/gh-stack

Why does `gh stack rebase --upstack` include the current branch?

Abierto
#160 2 comentarios 0 reacciones 0 asignados Ver en GitHub
question topic: cli - rebase
Lenguaje dominante
Go
Estrellas
1.5k
Forks
70
Merge medio
1 d 8 h
PR fusionados (30 d)
7

Descripción

Say I have the following stack

```
main <- branch1 <- branch2 <- branch3
```

I'm _on_ `branch1`, and just addressed some reviewer feedback by adding a few extra commits. Now I need to do the following:

- rebase `branch2` on `branch1`
- rebase `branch3` on `branch2`

I do _not_ want to rebase `branch1` on `main` right now.

My instinct is to call `gh stack rebase --upstack` while on `branch1`, where I just addressed the feedback and added commits. I was expecting that to do what I outlined above and not change `branch1` in any way.

Surprisingly (to me), it did this:
- rebase `branch1` on `main`
- rebase `branch2` on `branch1`
- rebase `branch3` on `branch2`

Can I ask about why `--upstack` includes a rebase of the current branch on the branch under it? That actually feels a bit "down stack"-ish to me.

It feels like this exact workflow is going to be pretty common for me, and the current workaround is for me to `gh stack switch` up to `branch2` and _then_ run `gh rebase --upstack`, but that feels pretty unnatural to me!

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

The entry point is `gh stack rebase --upstack`; first reproduce it on the stack described in the issue and inspect how the command selects branches. Compare the observed sequence with the requested sequence, then check the command's existing tests if available. Done means rebasing from `branch1` leaves it unchanged while rebasing `branch2` and `branch3` onto their updated predecessors.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
git, github, go
Área
cli, developer-experience
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.