Expand C-c a w into a worktree action menu - #504
Merged
Merged
Conversation
Owner
Author
|
@copilot resolve the merge conflicts in this pull request |
# Conflicts: # ai-code-git.el Co-authored-by: tninja <714625+tninja@users.noreply.github.com>
Contributor
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.
C-c a wonly offered worktree creation. The "open the centralized worktree directory" action was hidden behind aC-uprefix — invisible in the transient menu, and mislabeled as "status" when it actually runs Dired. Closes #501.Replaced the prefix-arg dispatch in
ai-code-git-worktree-actionwith acompleting-readover four named commands, following the existingai-code-derive-architecture-documentpattern:ai-code-git-worktree-branch, kept as the completion default sow RETbehaves exactly aswdid beforeC-ubranch, extracted into a newai-code-git-worktree-open-dircommandmagit-worktree-statusmagit-worktree-deleteDispatch uses
call-interactivelyrather thanfuncall, since every candidate has its owninteractivespec that reads arguments. Theai-code-git-worktree-rootcheck also moved out of the entry point intoai-code--validate-git-worktree-root, called only by the two actions that need it — otherwise users without that variable configured would be blocked from deleting or visiting worktrees, which do not depend on it at all.ai-code-git-worktree-branchnever had this check and now gets it: with the root nil,expand-file-namesilently fell back to a relative path and created a worktree inside the repository.Verification:
test_ai-code-git.el24/24 — the three prefix-behavior tests are replaced by nine covering the completion default, all four dispatch paths, the Magit-backed entries working withai-code-git-worktree-rootunset, and the newopen-direrror cases.test_ai-code.el50/50, including theai-code--menu-agile-developmenttransient assertions touched by the label change. Both changed sources byte-compile and pass checkdoc with no warnings.Out of scope:
magit-worktree-deletestill does not clean up the task-file symlink association or session-link records thatai-code--worktree-create-and-link-task-filesets up. The real task file lives in the main repo's.ai.code.files/, so nothing is lost.