rig 3.26.0
rig tells the truth when a staged work lands (#226)
rig tells the truth when a staged work lands
Tickets: #192, #200, #181, #193
Direction
Four stages, stacked on the work branch, one ticket each. Each one makes a rig reader say what is true at the moment a staged work lands.
- #192, unpushed means not on the remote (
fix/unpushed-means-not-on-the-remote).aheadis measured against@{u}, and a work branch's upstream is its base, so it counts commits not on main.worktrees.state()gainsunpushed: the commits on HEAD that no remote branch holds (rev-list HEAD --not --remotes=origin). For a pushed branch that is the distance fromorigin/<branch>; for one never pushed it is everything over its base.rig next's push and PR offers andworkState's "unpushed" blocker read it.ahead/behindstay the distance from the base, which is whatstatusandlistprint.bin/checkouts.mjsmeasures the data root and the tool, whose upstream is their own branch, so it is left alone. - #200, a worktree left on a landed stage (
fix/a-worktree-left-on-a-landed-stage).state()names the branch the worktree is on. Once every stage is in,rig nextnames each repo still on a stage branch and gives the command that moves it to the work branch;rig prsays the same beside the PR it opens. rig only names the command: it never moves a branch behind you. - #181, a close fetches the merged PR's head (
fix/close-fetches-the-merged-pr-head).dropMergedtakes the PR number, and when the mirror lacks the PR's head commit it fetchesrefs/pull/<n>/headfirst. A failed fetch keeps the copy with the fetch error as the reason. - #193, a squash-merged stage (
fix/say-when-a-stage-was-squashed). A stage whose PR merged but whose tip is not an ancestor of the work branch was squashed. When the squash commit's tree equals the stage tip's tree,rig nextoffersgit rebase --onto origin/<work> <stage tip> <next stage>with real SHAs. Otherwise it says the stage was squashed and offers no command.
Not in scope: changing what upstream rig attach gives a work branch. That would change what git pull and git status say in every worktree, and #192 is fixed without it.
Stages
| Order | Stage | Delivers | Repos | PR | State |
|---|---|---|---|---|---|
| 1 | fix/unpushed-means-not-on-the-remote |
rig next counts unpushed commits against the remote, not the base | rig | #205 | landed |
| 2 | fix/a-worktree-left-on-a-landed-stage |
rig next and rig pr name the switch back to the work branch once every stage is in | rig | #211 | landed |
| 3 | fix/close-fetches-the-merged-pr-head |
rig close fetches a merged PR's head before deciding a branch has commits the PR did not | rig | #212 | landed |
| 4 | fix/say-when-a-stage-was-squashed |
rig next names a squash-merged stage and the rebase that replays the next stage onto the work branch | rig | #215 | landed |
Context doc: https://github.com/hugoforte/rig-data/blob/main/work/stack-landing/context.md
Full changelog: v3.25.0...v3.26.0