fix: devcontainer exec eats -- breaking bash positional args#535
fix: devcontainer exec eats -- breaking bash positional args#535joshsmithxrm merged 1 commit intomainfrom
Conversation
`devcontainer exec` consumes `--` as its own end-of-options marker, so `bash -c 'cd "$1" ...' -- $workdir` never receives `--`. This shifts all positional params: $0 gets workdir, $1 gets the next arg (often a commit SHA), causing `cd` to fail on worktree commands. Replace `--` with `_` as the throwaway $0 value across all 14 call sites. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @joshsmithxrm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug in the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly addresses a bug where devcontainer exec consumes the -- argument, which was breaking positional argument passing to bash -c scripts. The fix, which replaces -- with _ as a placeholder for the $0 argument, is sound and has been applied consistently across all 14 identified call sites in scripts/devcontainer.ps1.
The suggestions to further improve debuggability by using a more descriptive name like 'bash' instead of _ for the $0 argument are valid and will make potential error messages from the shell more informative. Overall, this is a good fix.
Summary
devcontainer execconsumes--as its own end-of-options marker, preventing it from reachingbash -cas the$0placeholder$1receives the wrong value (e.g., a commit SHA instead of a workdir path), causingcdfailures when operating on worktrees--with_(standard throwaway$0) across all 14bash -ccall sites in the push, rebase, and ppds commandsTest plan
dev pushtargeting a worktree and verify it pushes correctlydev ppdstargeting a worktree and verify TUI launches in the right directorydev rebasetargeting a worktree and verify rebase operates on the correct branch🤖 Generated with Claude Code