github / github/gh-stack

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

未关闭
#160 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
question topic: cli - rebase
主要语言
Go
星标
1.5k
派生
70
平均合并
1 天 8 小时
30 天内合并 PR
7

描述

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!

贡献指南

打开贡献指南

调研方向

入口点是 `gh stack rebase --upstack`;首先在 issue 中描述的 stack 上重现该问题,并检查命令如何选择分支。将观察到的顺序与所要求的顺序进行比较,然后检查该命令现有的测试(如果有)。当 rebase `branch1` 后它保持不变,而 `branch2` 和 `branch3` 被 rebase 到各自更新后的前置分支上时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
git, github, go
领域
cli, developer-experience
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。