{"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":"anyhow::Error","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/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs#L27-L63","documentation":"Raised by `parse_integration_steps_script` (parsing.rs) when a script line starts with `pick` but also contains a `| message=...` clause. Only `squash` accepts a message clause; `pick` has no message of its own. The line number in the message is 1-based within the edited script.","triggerScenarios":"Script line like `pick 4f2a9c1 | message=\"fix\"` — `split_message_clause` splits on the first `|`, so pick sees a Some(message_part) and bails. Any attempt to reword while picking hits this.","commonSituations":"Users familiar with git rebase's `reword`/`pick <sha> <subject>` syntax try to attach a message to pick; or a UI round-trips a squash line into a pick line but keeps the message clause.","solutions":["Remove the `| message=...` clause from the pick line: `pick 4f2a9c1`.","If you want pick + different message, use a `squash` step with a single intent or adjust the plan upstream — the grammar only supports messages on squash.","Check the script against `render_integration_steps_script` output for the canonical format before submitting."],"exampleFix":"# before\npick 4f2a9c1 | message=\"new message\"\n\n# after\npick 4f2a9c1","handlingStrategy":"validation","validationCode":"// Dry-run the script through the parser before applying:\nlet steps = but_workspace::branch::integrate_branch_upstream::parse_integration_steps_script(&script, &divergence)\n    .map_err(|e| user_friendly(e))?; // surfaces 'line N: pick does not accept a message clause'","typeGuard":null,"tryCatchPattern":"match parse_integration_steps_script(&script, &divergence) {\n    Ok(steps) => { /* proceed to integrate_branch_with_steps */ }\n    Err(err) => show_editor_error(err.to_string()), // errors carry 'line N:' context already\n}","preventionTips":["Always parse/validate the edited script before integration; the parse errors include line numbers, ideal for editor highlighting.","Generate the editable script with render_integration_steps_script so users start from valid syntax.","Document the grammar in the editor UI: only squash accepts `| message=\"...\"`."],"tags":["rust","git","but-workspace","integration","todo-script","parsing"],"backgroundTag":"rebase-todo-parse-error","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}