Skip to content

fix: improve status detection for in-progress and closed workspaces#18

Merged
milldr merged 5 commits intomainfrom
fix/status-logic
Mar 4, 2026
Merged

fix: improve status detection for in-progress and closed workspaces#18
milldr merged 5 commits intomainfrom
fix/status-logic

Conversation

@milldr
Copy link
Owner

@milldr milldr commented Mar 3, 2026

What

  • Fix in-progress check to detect branches with commits ahead of the default branch (not just unpushed commits or dirty working tree)
  • Fix closed check to guard against false positives from stale merged PRs with the same branch name
  • Implement skip field in status spec so repos on the default branch are excluded from status aggregation
  • Fix Fetch() to create origin/main and origin/HEAD tracking refs in bare-clone worktrees so status checks can reliably compare against the default branch

Why

Two bugs in flow status:

  1. Workspaces with pushed branches (commits ahead of main, clean working tree, no PR yet) showed as open instead of in-progress — the check only compared local HEAD vs remote tracking branch, missing the "branch diverged from default" case
  2. Workspaces showed as closed when they had active uncommitted work, because a stale merged PR with the same branch name existed — the check didn't verify the branch had no remaining divergence from the default branch

Additionally, the skip field was defined in ~/.flow/status.yaml but never parsed or evaluated, so repos tracking the default branch (e.g. main) polluted workspace status aggregation.

Ref

Bare-clone worktrees don't create refs/remotes/origin/* by default, so origin/main was unavailable for comparisons. The fix creates a targeted tracking ref for just the default branch during fetch (avoiding case-conflict errors on macOS from repos with case-colliding branch names).

@milldr milldr force-pushed the fix/status-logic branch from d648518 to fdda43a Compare March 4, 2026 17:11
@milldr milldr merged commit 44326a3 into main Mar 4, 2026
3 checks passed
@milldr milldr deleted the fix/status-logic branch March 4, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant