Repository navigation
fix(worktree-audit): show behind and diverged remotes instead of ahead0 - #453
Conversation
The REMOTE column ran only `rev-list --count origin/<branch>..HEAD`, so a branch that someone else had advanced printed `ahead0`, which reads as in sync. It now counts both sides with `--left-right` and prints `aheadN`, `behindN`, or `aheadN,behindN`. Display only: `classify` reads whether the remote fact is known, not its text, so no worktree changes its safe or hold verdict.
Drop the ahead case, which the tag test already covers, and the pushes and fetch that leave the remote-tracking ref where a single push puts it. Drop -q from the git calls, and say in the comment what order --left-right prints the counts in.
|
Thanks for this. The
The trimmed test still fails on |
|
@wattanartongtipsukon-create, thank you for the fix. A REMOTE column that read I pushed fd033a4 on top of your commit with small trims to the test and the source comment, listed in my comment above. The fix itself is unchanged. Please pull before doing any more work on |
|
Merged. Thanks again @wattanartongtipsukon-create. The next release's |
What and why
worktree-auditran onlyrev-list --count origin/<branch>..HEAD, so a branch that someone else had advanced printedahead0, which reads as in sync even when the worktree is behind or diverged. It now counts both sides with--left-rightand printsaheadN,behindN, oraheadN,behindN. The pushed and no-remote cases are unchanged.Before / after, for a worktree whose pushed branch has one commit the worktree lacks, then one that has a commit each side:
Display only:
classifyreads whether the remote fact is known, not its text, so no worktree changes its safe or hold verdict. Not related to #423 (trunk ancestry), #424 (prefer an open PR) or #425 (compressed Codex rollouts).Linked issue
None.
Test run
The skips are the suite's usual opt-in and platform-conditional tests; I skipped no check. I did not run the runtime-specific smoke checks, because the PR touches no Pi, hook, Copilot, Grok or MiniMax path.
On bare
upstream/main(bc09365) the new test alone fails:Expected "behind1", Received "ahead0". It passes on this branch.Checklist
bun install --frozen-lockfile,bun tools/generate.mjs, andbun test tests/, and committed the generator's output. (The generator wrote nothing new.)bun tools/generate.mjs --checkexits 0.plugins/pstack/models.json, and every Pi model ID is in Pi's catalog for that provider. (No model defaults changed.)CHANGES.mdentry and bumpsVERSION, or names the release PR that will. (Display string in a script only; I left CHANGES.md and VERSION alone so this does not collide with the next release PR. Happy to add the entry and bump if you prefer.)plugins/pstack/pi/,pi-tools.md,plugins/pstack/hooks/,copilot-tools.md, orsetup-pstack, I ran the runtime checks that CONTRIBUTING.md lists for those paths. (Not touched.)