gitbutlerapp/gitbutler · error

line : pick does not accept a message clause

Error message

line {line_number}: pick does not accept a message clause

What it means

The integration steps script parser (rebase-todo-like syntax) allows an inline message clause on most commands, but `pick` must consist of exactly the command and one commit hash. A message clause after a pick is a syntax error reported with the offending line number.

Solutions

  1. Remove the message clause, keeping only `pick <commit>` on that line
  2. Use `pick <commit>` plus a separate step kind that supports messages (e.g. the message-bearing commands) if a description is needed
  3. Fix the script generator to strip commit subjects from pick lines

Example fix

// before
pick 1a2b3c4 fix the login bug
// after
pick 1a2b3c4
Defensive patterns

Strategy: validation

Validate before calling

// strip any message clause from pick lines before parsing
let cleaned: Vec<String> = script.lines()
    .map(|l| if l.starts_with("pick ") { l.split_whitespace().take(2).collect::<Vec<_>>().join(" ") } else { l.to_string() })
    .collect();

Try / catch

match parse_integration_steps_script(&script) {
    Err(e) if e.to_string().contains("pick does not accept a message clause") => /* regenerate script without messages */,
    Err(e) => return Err(e.into()),
    Ok(steps) => steps,
}

Prevention

When it happens

Trigger: Parsing an integration-steps script where a `pick <commit> <message>` line includes a trailing message — e.g. hand-written scripts or tooling that copied rebase-todo comments into the pick lines.

Common situations: Users editing the generated steps file and appending descriptions; generating the script from a real git rebase todo which includes commit subjects after picks.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18). Data as JSON: /api/errors/4b62399d329db3b2. Report an issue: GitHub.

Appendix: source

Thrown at crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs:45

        let line_number = line_number + 1;
        let line = line.to_str_lossy();
        let trimmed = line.trim();
        if trimmed.is_empty() || trimmed.starts_with('#') {
            continue;
        }

        let (command_part, message_part) = split_message_clause(trimmed)
            .with_context(|| format!("line {line_number}: invalid message clause"))?;
        let tokens = command_part.split_whitespace().collect::<Vec<_>>();
        let Some(command) = tokens.first().copied() else {
            continue;
        };
        let arguments = tokens.get(1..).unwrap_or_default();

        let step = match command {
            "pick" => {
                if message_part.is_some() {
                    bail!("line {line_number}: pick does not accept a message clause");
                }
                if arguments.len() != 1 {
                    bail!("line {line_number}: pick requires exactly one commit");
                }
                let commit = arguments
                    .first()
                    .copied()
                    .expect("validated pick arity above");
                InteractiveIntegrationStep::Pick {
                    commit_id: resolve_commit(commit, &allowed_commits).map_err(|err| {
                        anyhow::anyhow!("line {line_number}: invalid pick commit: {err}")
                    })?,
                }
            }
            "merge" => {
                if message_part.is_some() {
                    bail!("line {line_number}: merge does not accept a message clause");
                }

View on GitHub (pinned to 58e5313667)