Skip to content

feat: enhanced drift details in gw status - #34

Merged
jondeibel merged 1 commit into
mainfrom
feat/enhanced-drift-details-status
Mar 8, 2026
Merged

jondeibel merged 1 commit into
mainfrom
feat/enhanced-drift-details-status

Conversation

@jondeibel

Copy link
Copy Markdown
Owner

Summary

  • Show commit counts in gw status drift flags: "3 behind parent, needs rebase" and "diverged (2 ahead, 1 behind remote)" instead of boolean flags
  • Fix bug where branches only behind remote incorrectly showed as "pushed" (up-to-date) in both gw status and gw tree
  • Fix bug where [gone] remote tracking state (deleted remote branch) showed as "pushed" instead of "not pushed"
  • Consolidate rev_parse + boolean check into a single rev_list_count call — net zero new git subprocess calls

Test plan

  • All 145 existing tests pass
  • New unit tests for parse_count_after cover all 5 %(upstream:track) format variants
  • Manual test: gw status shows clean output when no drift
  • Manual test: behind-parent count displays correctly
  • Manual test: behind-remote-only scenario shows "N behind remote" (previously showed "pushed")
  • Manual test: diverged scenario shows ahead/behind counts
  • Manual test: deleted remote branch shows "not pushed"

Post-Deploy Monitoring & Validation

No additional operational monitoring required: CLI tool with local-only changes to display formatting.

🤖 Generated with Claude Code

Enhance gw status to show commit counts for drift detection instead of
boolean flags. Fix two bugs in both status.rs and tree.rs where branches
that are only behind remote or have a [gone] remote incorrectly report
as up-to-date.

Changes:
- Show "N behind parent, needs rebase" instead of "needs rebase"
- Show "diverged (N ahead, M behind remote)" instead of "diverged"
- Fix behind-remote-only bug (was falling through to UpToDate)
- Handle [gone] tracking state as NoRemote
- Add Behind variant to tree.rs RemoteStatus for consistency
- Consolidate rev_parse + boolean into rev_list_count (net 0 new git calls)
- Add parse_count_after helper with unit tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jondeibel
jondeibel merged commit 8188db6 into main Mar 8, 2026
6 checks passed
@jondeibel
jondeibel deleted the feat/enhanced-drift-details-status branch March 8, 2026 05:06
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