{"record":{"id":"4b62399d329db3b2","repo":"gitbutlerapp/gitbutler","slug":"line-line-number-pick-does-not-accept-a-message","errorCode":null,"errorMessage":"line {line_number}: pick does not accept a message clause","messagePattern":"line (.+?): pick does not accept a message clause","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs","lineNumber":45,"sourceCode":"        let line_number = line_number + 1;\n        let line = line.to_str_lossy();\n        let trimmed = line.trim();\n        if trimmed.is_empty() || trimmed.starts_with('#') {\n            continue;\n        }\n\n        let (command_part, message_part) = split_message_clause(trimmed)\n            .with_context(|| format!(\"line {line_number}: invalid message clause\"))?;\n        let tokens = command_part.split_whitespace().collect::<Vec<_>>();\n        let Some(command) = tokens.first().copied() else {\n            continue;\n        };\n        let arguments = tokens.get(1..).unwrap_or_default();\n\n        let step = match command {\n            \"pick\" => {\n                if message_part.is_some() {\n                    bail!(\"line {line_number}: pick does not accept a message clause\");\n                }\n                if arguments.len() != 1 {\n                    bail!(\"line {line_number}: pick requires exactly one commit\");\n                }\n                let commit = arguments\n                    .first()\n                    .copied()\n                    .expect(\"validated pick arity above\");\n                InteractiveIntegrationStep::Pick {\n                    commit_id: resolve_commit(commit, &allowed_commits).map_err(|err| {\n                        anyhow::anyhow!(\"line {line_number}: invalid pick commit: {err}\")\n                    })?,\n                }\n            }\n            \"merge\" => {\n                if message_part.is_some() {\n                    bail!(\"line {line_number}: merge does not accept a message clause\");\n                }","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs#L27-L63","documentation":"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.","triggerScenarios":"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.","commonSituations":"Users editing the generated steps file and appending descriptions; generating the script from a real git rebase todo which includes commit subjects after picks.","solutions":["Remove the message clause, keeping only `pick <commit>` on that line","Use `pick <commit>` plus a separate step kind that supports messages (e.g. the message-bearing commands) if a description is needed","Fix the script generator to strip commit subjects from pick lines"],"exampleFix":"// before\npick 1a2b3c4 fix the login bug\n// after\npick 1a2b3c4","handlingStrategy":"validation","validationCode":"// strip any message clause from pick lines before parsing\nlet cleaned: Vec<String> = script.lines()\n    .map(|l| if l.starts_with(\"pick \") { l.split_whitespace().take(2).collect::<Vec<_>>().join(\" \") } else { l.to_string() })\n    .collect();","typeGuard":null,"tryCatchPattern":"match parse_integration_steps_script(&script) {\n    Err(e) if e.to_string().contains(\"pick does not accept a message clause\") => /* regenerate script without messages */,\n    Err(e) => return Err(e.into()),\n    Ok(steps) => steps,\n}","preventionTips":["Never append commit subjects to pick lines in generated scripts","Validate scripts before handing them to the parser","Use the renderer's output as the canonical script format"],"tags":["parsing","script","syntax"],"backgroundTag":"invalid-argument-format","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}