Repository navigation
Conversation
Branches more than 50 commits behind the default branch now skip expensive merge-base operations (HasFileChanges, IsAncestor, WouldMergeAdd, BranchDiff, MergeTreeConflicts). This dramatically improves performance for `wt select` on repos with many stale branches. Uses `git for-each-ref --format='%(ahead-behind:...)'` (git 2.36+) to batch fetch ahead/behind counts in a single command, then uses those counts both to determine which branches to skip and to populate the AheadBehind result (avoiding the loss of data that would occur if we skipped the task entirely). Only enabled for `wt select` (gated on command_timeout, not render_table, so JSON mode still gets full data). Degrades gracefully on older git versions by running all tasks. Closes #461 Co-Authored-By: Claude <[email protected]>
When expensive tasks are skipped for stale branches, show `…` in the BranchDiff column to indicate "not computed" rather than showing blank (which is ambiguous with "zero changes"). Status symbols (conflict ✗, integrated ⊂) may still be missing or incorrect for skipped branches, but the presence of `…` signals that the row has incomplete data. Co-Authored-By: Claude <[email protected]>
When expensive tasks are skipped for stale branches, show `…` in the BranchDiff column to indicate "not computed" rather than showing blank (which is ambiguous with "zero changes"). Status symbols (conflict ✗, integrated ⊂) may still be missing or incorrect for skipped branches, but the presence of `…` signals that the row has incomplete data. Also adds explicit `skip_expensive_for_stale` parameter to `collect()` instead of using `command_timeout.is_some()` as a proxy. Co-Authored-By: Claude <[email protected]>
- apply_default() for BranchDiff now leaves branch_diff as None instead of Some(default()), so UI shows `…` for both skipped and failed tasks - batch_ahead_behind() now logs errors at debug level with the base ref included, instead of silently ignoring Co-Authored-By: Claude <[email protected]>
Adds integration test that uses WORKTRUNK_TEST_SKIP_EXPENSIVE_THRESHOLD env var to trigger the skip behavior in `wt list --full`, showing the `…` indicator in the BranchDiff column for stale branches. Co-Authored-By: Claude <[email protected]>
Note that wt select doesn't show BranchDiff column, so the `…` indicator isn't visible there. Similar to how `✗` conflict only shows with --full. Co-Authored-By: Claude <[email protected]>
Adds test exercising the --branches code path for skip_expensive_for_stale, which uses a different code section than the worktree test. Co-Authored-By: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wt selectgit for-each-ref --format='%(ahead-behind:main)'(git 2.36+) to batch-fetch ahead/behind counts in a single command…in BranchDiff column when tasks are skipped, distinguishing "not computed" from "zero changes"skip_expensive_for_stale: boolparameter tocollect()—wt listpassesfalse,wt selectpassestrueTest plan
🤖 Generated with Claude Code