Skip to content

fix(statusline): layered base branch detection#70

Merged
dean0x merged 1 commit intomainfrom
fix/statusline-base-branch-detection
Feb 25, 2026
Merged

fix(statusline): layered base branch detection#70
dean0x merged 1 commit intomainfrom
fix/statusline-base-branch-detection

Conversation

@dean0x
Copy link
Owner

@dean0x dean0x commented Feb 25, 2026

Summary

  • Replace hardcoded main/master base branch check with a 4-tier fallback chain
  • Fixes incorrect diff stats and commit counts for branches created off develop, staging, or other non-default branches

Detection layers

  1. Branch reflogCreated from <branch> (instant, explicit base)
  2. HEAD reflogmoving from X to <branch> (instant, implicit base)
  3. GitHub PR basegh pr view with /tmp file cache, 5-min TTL (~500ms first call, then cached)
  4. main/master fallback — existence check (previous behavior)

Test plan

  • npm test — 118/118 pass
  • Smoke test on main — status line renders correctly
  • Rebuild + reinstall — installed script matches source (diff clean)

…ain/master

Replace the hardcoded main/master check with a 4-tier fallback chain:
1. Branch reflog ("Created from <branch>") for explicit base
2. HEAD reflog ("moving from X to <branch>") for implicit base
3. GitHub PR base branch via gh CLI (cached 5-min TTL)
4. main/master existence check (previous behavior)

This fixes incorrect diff stats for branches created off develop,
staging, or other non-default branches.
@dean0x dean0x merged commit 70d779c into main Feb 25, 2026
3 checks passed
@dean0x dean0x deleted the fix/statusline-base-branch-detection branch February 25, 2026 20:20
dean0x pushed a commit that referenced this pull request Feb 25, 2026
- Update release date to 2026-02-25
- Add /review → /code-review rename under Changed
- Add statusline base branch detection fix (#70) under Fixed
- Add stale CLAUDE.md files array fix under Fixed
- Add landing page reference under Changed
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