Skip to content

fix(git): preserve worktree repair and list semantics - #3752

Closed
arkgum wants to merge 1 commit into
rtk-ai:developfrom
arkgum:fix/git-worktree-native-semantics
Closed

arkgum wants to merge 1 commit into
rtk-ai:developfrom
arkgum:fix/git-worktree-native-semantics

Conversation

@arkgum

@arkgum arkgum commented Aug 29, 2026

Copy link
Copy Markdown

Summary

  • route every non-list worktree subcommand to git unchanged, fixing repair and future action subcommands
  • preserve explicit list arguments and return native output for --porcelain and -z while retaining filtering for human-readable lists
  • add regression coverage for subcommand-slot detection, argument forwarding, machine-readable list modes, and repairing pointers after a repository move

Closes #3710

Test plan

  • cargo fmt --all --check
  • cargo clippy --all-targets
  • cargo test (not run locally; the full suite will run in CI)
  • Manual testing: rtk git worktree repair output inspected

@amandeavor amandeavor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested this on Windows and walked through the routing changes. All six worktree-related tests pass here, including the integration test that moves a repository and verifies git worktree repair updates the linked worktree pointer.

The mode split also looks right: only the actual list subcommand is filtered, unknown or future subcommands pass through as actions, and --porcelain / -z keep native output. cargo fmt --all --check and cargo clippy --all-targets are clean on this branch.

Looks good to me.

@arkgum

arkgum commented Sep 6, 2026

Copy link
Copy Markdown
Author

Hi maintainers — a gentle follow-up on this fix for #3710. It preserves native behavior for worktree actions and machine-readable list output. The PR has an approving review with Windows verification, but the Actions run is still waiting for maintainer approval.

Could someone approve the CI run and review it when time permits? It also covers the lost prune --dry-run report mentioned in #3838; that issue's separate exclusion-matching fix remains out of scope. Happy to address any feedback. Thanks!

@KuSh

KuSh commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Closing in favour of #3681, which fixes the same #3710 behaviour: repair and any other non list subcommand pass through to git unchanged, and list with --porcelain or -z returns native output. It also carries the shared argument tokenizer that the rest of that fix is built on. Review and comments are very welcome on #3681.

@KuSh KuSh closed this Sep 6, 2026
@KuSh KuSh added the duplicate This issue or pull request already exists label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

git worktree repair is routed to list mode: prints the worktree list, exits 0, repairs nothing

3 participants