gitq stacks
Lists every stack this repo tracks, and each one's branch chain from root to tip.
Usage
bash
gitq stacks
Behavior
Loads the store and prints one line per tracked stack: <stackName> (root <rootBranch>): <branch> -> <branch> -> ... in tree order, parent before child (formatStackLine, src/cli/commands/stacks.ts). A stack with no nodes yet prints empty for the chain. A repo with no tracked stacks prints no stacks.
- A fork starts a new chain that names its parent. A chain runs through each branch's first child; every later child starts its own chain, separated by
;:a -> b; a -> cisawith two children.--jsonkeeps the nodes in stored order, so readparentthere rather than the array order. - This is the store's view, not git's. It says nothing about whether a branch is up to date or still exists in git; see
gitq diagnosefor that. - Takes no flags beyond the global ones. Under
--json, the document is{ stacks, worktrees }: the fullStack[]from the store, plus aworktreesarray describing every worktree of the repo and which lease (if any) it holds. See JSON output.
Exit codes
0: always, once the store loads.stackshas no refusal of its own.
See Exit codes for the general contract, including the uncaught-error case every command shares.
See also
- Reading the tree:
stacksin context. - The stack tree: what a node stores and what the tree does and doesn't guarantee about ordering.
gitq diagnose,gitq track.