fix: filter worktrees by version in GitCommand#137
Merged
Conversation
brinkflew
previously approved these changes
Mar 23, 2026
brinkflew
previously approved these changes
Mar 23, 2026
Contributor
|
Code ok but pre-commit fails |
sea-odoo
added a commit
that referenced
this pull request
Mar 24, 2026
* fix: only process requested version worktrees in GitCommand * fix: respect ODEV_NO_SSH_AGENT and handle decryption failure gracefully * fix: correctly handle detached HEAD and missing upstream in worktrees * fix: resolve pre-commit issues and improve robustness * chore: bump version to 4.26.0
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.
Problem
When running
odev pull -V <version>(e.g. during an AI upgrade session), the command iterated over all local worktrees (master, 13.0, 14.0, 16.0, 17.0, 18.0, 19.0, etc.) instead of only the requested version. This caused unnecessary fetching, slow startup, and noisy log output.Root Cause
The
GitCommand.worktreesproperty inodev/common/commands/git.pyyielded all worktrees from all repositories without checking the--version(-V) argument, even though the argument was already defined on theGitCommandclass.Fix
Added a filter in the
worktreesgenerator so that whenself.args.versionis set, only worktrees whose name matches the requested version are yielded. This ensures commands likepull,fetch, andworktreeonly process the relevant version.Impact
odev pull -V 19.0now only pulls worktrees for version19.0odev fetch -V 19.0now only fetches worktrees for version19.0-Vis not specified (all worktrees are still processed)AI Agent & SSH Agent Fixes
AI Agent & SSH Agent Fixes