enh: bind mount original repo when running in a git worktree#19
enh: bind mount original repo when running in a git worktree#19yarikoptic merged 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I've encountered this also, so I'm very happy to see this! I wonder though if we should consider making it optional and off by default. My reasoning
wdyt? |
|
arguments do make sense! I guess we better make it also "explicit" as ask user unless specified... @copilot can improve this PR to add an option |
|
@yarikoptic I've opened a new pull request, #22, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@copilot please address conflicts |
|
@yarikoptic I've opened a new pull request, #24, to work on those changes. Once the pull request is ready, I'll request review from you. |
When the workspace is a git worktree (detected via .git being a symlink or a file with gitdir: reference), add a bind mount for the original repository. This allows Claude to access the original repo's git objects and references, and perform git operations (commit, fetch, etc.). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Austin Macdonald <austin@dartmouth.edu> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Austin Macdonald <austin@dartmouth.edu> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Co-Authored-By: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
@yarikoptic ready for review. (I couldnt request review, so I've also invited you to join project as admin) |
README.md
Outdated
| yolo --worktree=bind | ||
|
|
||
| # Never bind mount, run without error | ||
| yolo --worktree=ok |
There was a problem hiding this comment.
Actually I think this should be "no", ok doesnt match the behavior IMO
More intuitive name for the option that skips bind mounting. Co-Authored-By: Austin Macdonald <austin@dartmouth.edu> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When the workspace is a git worktree (detected via .git being a symlink or a file with gitdir: reference), add a bind mount for the original repository. This allows Claude to access the original repo's git objects and references, and perform git operations (commit, fetch, etc.).
🤖 Generated with Claude Code
note: bind mount 'rw' so we could commit etc
Updates (added by Claude Code)
Addressed review feedback
Per @asmacdo's feedback about security concerns with silent bind mounting, added
--worktreeoption with four modes:ask(default): Prompts user with security warning before bind mountingbind: Automatically bind mounts original repook: Skip bind mounting and continue normallyerror: Exit if worktree detectedContributors
--worktreeoption modes: GitHub Copilot (PR Add --worktree option to control original repo bind mounting #22 merged into this branch)Usage
Security note: Bind mounting the original repo exposes more files and allows modifications. The
askprompt helps prevent unintended access.