nikivdev/code · error

--all cannot be combined with HASH. Use `f commit-queue appr

Error message

--all cannot be combined with HASH. Use `f commit-queue approve --all`.

What it means

Argument validation for `f commit-queue approve` (src/commit.rs:9208): passing `--all` together with a positional HASH is contradictory (approve everything vs. approve one), so the CLI bails with the correct usage.

Source

Thrown at src/commit.rs:9208

                clean, with_issues, timed_out, failed
            );

            if failed > 0 {
                bail!("Some queued commit reviews failed. Resolve errors and re-run.");
            }
        }
        CommitQueueAction::Approve {
            all,
            hash,
            queue_if_missing,
            mark_reviewed,
            force,
            allow_issues,
            allow_unreviewed,
        } => {
            if all {
                if hash.is_some() {
                    bail!(
                        "--all cannot be combined with HASH. Use `f commit-queue approve --all`."
                    );
                }
                if queue_if_missing {
                    eprintln!("note: --queue-if-missing is ignored when using --all");
                }
                if mark_reviewed {
                    eprintln!("note: --mark-reviewed is ignored when using --all");
                }
                return approve_all_queued_commits(
                    &repo_root,
                    force,
                    allow_issues,
                    allow_unreviewed,
                );
            }

            git_guard::ensure_clean_for_push(&repo_root)?;

View on GitHub (pinned to a747e741ae)

Solutions

  1. Drop the HASH and use `f commit-queue approve --all`, or
  2. drop `--all` and approve only the specific hash: `f commit-queue approve <hash>`.
  3. Fix the script to emit either --all or a hash, never both.

Example fix

// before
f commit-queue approve --all 9abc123
// after
f commit-queue approve --all
// or
f commit-queue approve 9abc123
Defensive patterns

Strategy: validation

Validate before calling

if all && hash.is_some() {
    bail!("--all cannot be combined with HASH; choose one mode");
}

Try / catch

match approve(all, hash) {
    Err(e) if e.to_string().contains("cannot be combined with HASH") => {
        eprintln!("{e}");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Invoking `f commit-queue approve --all <hash>` — both the --all flag and a HASH argument supplied at once.

Common situations: Copy-pasted command lines that combined flags; shell scripts building arguments conditionally and appending both; assuming --all silently takes precedence.

Related errors


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