github / github/gh-stack

Github stack does not persist across worktrees

Ouverte
#459 1 commentaire 8 réactions 0 personnes assignées Voir sur GitHub
bug topic: cli - worktrees
Langage dominant
Go
Étoiles
1.5k
Forks
70
Merge moyen
1 j 8 h
PR mergées (30 j)
7

Description

When opening a branch in a worktree and running `gh stack init`, it does not keep track of the stack locally. `gh-stack` keeps stack membership in local state tied to the checkout where `init` ran. If I create a worktree & use `gh-stack`, the stack doesn't persist on my machine, even if I open the branch back in my main worktree. Inside a worktree, $GIT_DIR is .git/worktrees// — so `worktree remove` deletes the stack state with it

This is confusing & not obvious. Additionally, a modern LLM workflow may involve different sub-agents in different worktrees. This makes gh-stack worse than, say git-spice for this purpose, since I can't easily update my work if I checkout the branch on my main worktree.

The stack _is_ stored remotely on Github, but THAT doesn't always work - seems like GitHub only records a stack for a chain of two or more PRs.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start with the `gh stack init` entry point and trace how local stack membership is stored when `$GIT_DIR` points into `.git/worktrees//`. Reproduce the behavior across a main worktree and a linked worktree, including `worktree remove`; done means stack membership remains available when the branch is opened from another worktree.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
git, github, go
Domaine
cli, tooling
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
52/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.