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 摘要。