Skip to content

fix: devcontainer exec eats -- breaking bash positional args#535

Merged
joshsmithxrm merged 1 commit intomainfrom
fix/devcontainer-bash-positional-args
Feb 13, 2026
Merged

fix: devcontainer exec eats -- breaking bash positional args#535
joshsmithxrm merged 1 commit intomainfrom
fix/devcontainer-bash-positional-args

Conversation

@joshsmithxrm
Copy link
Owner

Summary

  • devcontainer exec consumes -- as its own end-of-options marker, preventing it from reaching bash -c as the $0 placeholder
  • This shifts all positional parameters by one — $1 receives the wrong value (e.g., a commit SHA instead of a workdir path), causing cd failures when operating on worktrees
  • Replaced -- with _ (standard throwaway $0) across all 14 bash -c call sites in the push, rebase, and ppds commands

Test plan

  • Run dev push targeting a worktree and verify it pushes correctly
  • Run dev ppds targeting a worktree and verify TUI launches in the right directory
  • Run dev rebase targeting a worktree and verify rebase operates on the correct branch

🤖 Generated with Claude Code

`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>
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 devcontainer exec command's interaction with bash -c. Previously, the -- marker, intended to separate options from arguments for bash -c, was being consumed by devcontainer exec itself. This resulted in all subsequent positional arguments being shifted, causing commands like cd to fail when operating on worktrees. The fix involves replacing the problematic -- with _ as the $0 placeholder in all affected bash -c invocations, ensuring correct argument parsing and restoring proper functionality for push, rebase, and ppds operations within devcontainers.

Highlights

  • Argument Parsing Fix: Resolved an issue where devcontainer exec incorrectly consumed the -- end-of-options marker, leading to shifted positional arguments in bash -c commands.
  • Command Argument Correction: Updated 14 instances of bash -c calls within push, rebase, and ppds commands to use _ instead of -- as the $0 placeholder.
  • Worktree Functionality Restored: Fixed cd failures and incorrect worktree operations that were caused by the argument parsing error.
Changelog
  • scripts/devcontainer.ps1
    • Replaced -- with _ in bash -c commands to correctly pass positional arguments.
Activity
  • The pull request was generated using Claude Code.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

@joshsmithxrm joshsmithxrm merged commit 18a42b4 into main Feb 13, 2026
24 checks passed
@joshsmithxrm joshsmithxrm deleted the fix/devcontainer-bash-positional-args branch February 13, 2026 23:55
@github-project-automation github-project-automation bot moved this from Todo to Done in PPDS Roadmap Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant

Comments