github / github/gh-stack

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

Aberta
#160 2 comentários 0 reações 0 responsáveis Ver no GitHub
question topic: cli - rebase
Linguagem predominante
Go
Estrelas
1.5k
Forks
70
Merge médio
1d 8h
PRs com merge (30d)
7

Descrição

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!

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

O ponto de entrada é `gh stack rebase --upstack`; primeiro reproduza isso no stack descrito na issue e inspecione como o comando seleciona as branches. Compare a sequência observada com a sequência solicitada e, em seguida, verifique os testes existentes do comando, se disponíveis. Está concluído quando fazer rebase de `branch1` o deixa inalterado, enquanto `branch2` e `branch3` são rebased sobre seus predecessores atualizados.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
git, github, go
Domínio
cli, developer-experience
Tipo de issue
Funcionalidade
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Pouca atividade
Clareza
Razoavelmente clara
Facilidade para iniciantes
48/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.