{"record":{"id":"5b08d5c8ff45ee98","repo":"gitbutlerapp/gitbutler","slug":"line-line-number-merge-does-not-accept-a-messag","errorCode":null,"errorMessage":"line {line_number}: merge does not accept a message clause","messagePattern":"line (.+?): merge 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":62,"sourceCode":"                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                }\n                if arguments.len() != 1 {\n                    bail!(\"line {line_number}: merge requires exactly one commit\");\n                }\n                let commit = arguments\n                    .first()\n                    .copied()\n                    .expect(\"validated merge arity above\");\n                InteractiveIntegrationStep::Merge {\n                    commit_id: resolve_commit(commit, &allowed_commits).map_err(|err| {\n                        anyhow::anyhow!(\"line {line_number}: invalid merge commit: {err}\")\n                    })?,\n                }\n            }\n            \"squash\" => {\n                if arguments.len() < 2 {\n                    bail!(\"line {line_number}: squash requires at least two commits\");\n                }","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs#L44-L80","documentation":"`merge` steps in the integration script may not carry an inline message clause. The message clause is the optional `| message=\"...\"` suffix (split on the `|` character by `split_message_clause`). This error is raised when a `merge` line contains such a suffix, because merges always use the commit's existing message.","triggerScenarios":"Calling parse_integration_steps_script with a script line like `merge 4444444 | message=\"custom\"`. The `|` character anywhere after the command tokens on a `merge` line triggers it.","commonSituations":"A user copies the `squash ... | message=\"...\"` syntax and applies it to a `merge` line, assuming all steps support inline rewording, or an editor/tooling appends a suffix that includes a literal pipe character.","solutions":["Remove the `| message=\"...\"` clause from the `merge` line; the merge uses the commit's original message.","If a custom message is required for that content, convert the line to `squash <hash1> <hash2> | message=\"...\"`, which is the only step kind that accepts a message.","Verify there is no stray literal `|` character in the line (e.g. from shell-style formatting) that the parser interprets as a message clause."],"exampleFix":"// before (script text)\nmerge 4444444 | message=\"my merge\"\n// after\nmerge 4444444","handlingStrategy":"validation","validationCode":"function validateMergeLine(line: string, lineNo: number): string | null {\n  const trimmed = line.trim();\n  if (!trimmed.startsWith('merge')) return null;\n  if (trimmed.includes('|')) return `line ${lineNo}: merge does not accept a message clause`;\n  return null;\n}","typeGuard":"const mergeHasNoMessageClause = (line: string): boolean =>\n  !line.trim().startsWith('merge') || !line.includes('|');","tryCatchPattern":"try {\n  const steps = await parseIntegrationScript(script, divergence);\n} catch (err) {\n  const m = /line (\\d+): merge does not accept a message clause/.exec(String(err));\n  if (m) showEditorErrorAtLine(Number(m[1]), 'remove the | message=... clause from merge lines');\n  else throw err;\n}","preventionTips":["Only `squash` lines support `| message=\"...\"`; never add the clause to `pick` or `merge`.","Avoid a literal `|` anywhere on pick/merge lines (even in comments on the same line).","Start from the rendered script and change only hashes when editing."],"tags":["parsing","script-validation","git"],"backgroundTag":"unsupported-operation","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"}