gh stack modify: modify fails when merged branches have been pruned
- 主要言語
- Go
- スター
- 1.5k
- フォーク
- 70
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 7
説明
Looks like modify can't deal with pruned branches once they have been merged.
See below output:
```
➜ token-scanning-service git:(aerendel/fix-generic-secrets-metadata) gh stack modify
✗ failed to apply modifications: building snapshot: resolving branch SHAs: failed to run git: fatal: ambiguous argument 'aerendel/mixed-content-types1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
```
### Observed behavior:
The bottom of my stack has been merged and the branch pruned so it doesn't exist locally or remotely anymore (not unusual once a branch is merged), and all `gh stack modify` operations fail to save. Any operation will fail, wether it's renaming a branch, reorganizing, dropping a branch, etc.
### Repro:
1. Make a stack with 2 or 3 layers
2. Merge the first layer
3. Delete the first layer's branch locally (or just answer Yes to gh stack's prune prompt)
4. Run `gh stack modify` and try to save any modify operation
コントリビューションガイド
調査の方向性
gh stack modify フローと、ブランチの SHA を解決する snapshot ステップから始め、2 層または 3 層のスタックの最下層のブランチを削除して問題を再現します。マージされたブランチがローカルとリモートから削除された後でも、名前変更、再編成、削除、その他の modify 操作を正常に保存できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- git, go
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 68/100