Skip to content

fix: subcommand routing drops unrecognized subcommands (stash, branch, pip) #600

@pszymkowiak

Description

@pszymkowiak

Bug

Three command modules silently drop or misroute unrecognized subcommands:

1. git stash — subcommands dropped (P0)

save, branch, clear, store fall into the default _ => case which runs git stash (push) without the subcommand.

rtk git stash save "msg"    # FAILS: runs "git stash" instead of "git stash save msg"
rtk git stash branch foo    # FAILS: runs "git stash" instead of "git stash branch foo"
rtk git stash clear         # WRONG: runs "git stash" (push) instead of "git stash clear"

Location: src/git.rs:1288 — the _ => match arm only passes "stash" without the subcommand.

2. git branch --show-current — flag not detected (P0)

RTK injects -a when no "list flag" is detected. --show-current, --set-upstream-to, --format, --sort are not in the detection list.

rtk git branch --show-current  # WRONG: lists all branches instead of showing "develop"
git branch --show-current       # CORRECT: "develop"

Location: src/git.rs:1018-1028has_list_flag check is incomplete.

3. pip — errors on unknown subcommands (P0)

bail!() instead of passthrough for unrecognized subcommands.

rtk pip freeze      # ERROR: "unsupported subcommand 'freeze'"
rtk pip download    # ERROR: same
rtk pip wheel       # ERROR: same

Location: src/pip_cmd.rs:28_ => arm uses anyhow::bail!() instead of passthrough.

Fix

  1. git stash: Pass unrecognized subcommands through to git stash <sub> [args]
  2. git branch: Add missing flags to detection, or passthrough when specific flags like --show-current are present
  3. pip: Replace bail!() with run_passthrough() for unknown subcommands

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-criticalBloque des utilisateurs, fix ASAPbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions