Skip to content

fix(list): deduplicate concurrent ahead/behind counts - #4663

Merged
max-sixty merged 2 commits into
mainfrom
fix/issue-4662
Nov 2, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/issue-4662

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Two statusline tasks can request the same ahead/behind SHA pair concurrently when local main trails origin/main. Each previously missed the persistent cache and launched its own git rev-list --count. A per-repository, per-pair in-memory cache now holds the first computation while the other caller waits; the persistent cache still serves later processes.

The new statusline regression test reproduced two matching rev-list calls before the change and passes with at most one after it. cargo test --lib test_ahead_behind_reads_cache, the focused integration test, and cargo fmt --check pass.

Closes #4662 — automated triage

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regression test can pass without exercising the count it intends to deduplicate.

Comment thread tests/integration_tests/statusline.rs Resolved
@max-sixty
max-sixty merged commit d5a9e4f into main Nov 2, 2026
36 checks passed
@max-sixty
max-sixty deleted the fix/issue-4662 branch November 2, 2026 09:33
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.

Deduplicate concurrent ahead/behind rev-list calls in statusline

2 participants