nikivdev/code · error

Invalid review branch name: {}

Error message

Invalid review branch name: {}

What it means

`flow workspace` derives a workspace name from the review branch via review_workspace_name. If that produces an empty string (the branch name is unusable, e.g. empty or malformed), run_workspace bails rather than creating a workspace with an invalid identity.

Source

Thrown at src/jj.rs:601

        JjWorkspaceAction::Review {
            branch,
            path,
            base,
            remote,
            no_fetch,
        } => {
            let remote = remote.unwrap_or_else(|| default_remote(&ctx.repo_root));
            if !no_fetch {
                ensure_git_not_busy(&ctx.repo_root)?;
                if let Err(err) = jj_run_in(&ctx.workspace_root, &["git", "fetch"]) {
                    eprintln!("⚠ jj git fetch failed: {err}");
                    eprintln!("  continuing with current local refs");
                }
            }

            let workspace_name = review_workspace_name(&branch);
            if workspace_name.is_empty() {
                bail!("Invalid review branch name: {}", branch);
            }

            let workspace_path = match path {
                Some(p) => p,
                None => workspace_default_path(&ctx.repo_root, &workspace_name)?,
            };

            if let Some(existing_path) =
                existing_workspace_path(&ctx.workspace_root, &ctx.repo_root, &workspace_name)?
            {
                if existing_path != workspace_path {
                    bail!(
                        "Workspace {} already exists at {}",
                        workspace_name,
                        existing_path.display()
                    );
                }
                println!(

View on GitHub (pinned to a747e741ae)

Solutions

  1. Pass a valid review branch name: `flow workspace <valid-branch>`.
  2. Print the branch first (`jj bookmark list`) to confirm it is non-empty and well-formed.
  3. If the name contains odd characters, create or use a sanitized bookmark name.

Example fix

// before
flow workspace ""
// after
flow workspace feature/login-fix
Defensive patterns

Strategy: validation

Validate before calling

// shell
BRANCH="$1"
[ -n "$BRANCH" ] || { echo "usage: flow workspace <branch>" >&2; exit 2; }

Prevention

When it happens

Trigger: Calling `flow workspace` (run_workspace) with a review branch whose name normalizes to an empty workspace name — typically an empty or whitespace/symbol-only branch string.

Common situations: Passing an empty branch variable from a script; a branch name consisting only of characters the sanitizer strips; forgetting to pass the branch argument so an empty default flows in.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/d63dead02b3eb6d6. Report an issue: GitHub.