Skip to content

rig 3.26.0

Choose a tag to compare

@github-actions github-actions released this 29 Sep 19:30
ac8ea0d

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.

  1. #192, unpushed means not on the remote (fix/unpushed-means-not-on-the-remote). ahead is measured against @{u}, and a work branch's upstream is its base, so it counts commits not on main. worktrees.state() gains unpushed: the commits on HEAD that no remote branch holds (rev-list HEAD --not --remotes=origin). For a pushed branch that is the distance from origin/<branch>; for one never pushed it is everything over its base. rig next's push and PR offers and workState's "unpushed" blocker read it. ahead/behind stay the distance from the base, which is what status and list print. bin/checkouts.mjs measures the data root and the tool, whose upstream is their own branch, so it is left alone.
  2. #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 next names each repo still on a stage branch and gives the command that moves it to the work branch; rig pr says the same beside the PR it opens. rig only names the command: it never moves a branch behind you.
  3. #181, a close fetches the merged PR's head (fix/close-fetches-the-merged-pr-head). dropMerged takes the PR number, and when the mirror lacks the PR's head commit it fetches refs/pull/<n>/head first. A failed fetch keeps the copy with the fetch error as the reason.
  4. #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 next offers git 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