{"record":{"id":"6914978238e83cf4","repo":"gitbutlerapp/gitbutler","slug":"message-must-start-with-a-double-quote","errorCode":null,"errorMessage":"message must start with a double quote","messagePattern":"message must start with a double quote","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs","lineNumber":181,"sourceCode":"}\n\nfn split_message_clause(line: &str) -> Result<(&str, Option<&str>)> {\n    let Some((command_part, message_part)) = line.split_once('|') else {\n        return Ok((line, None));\n    };\n    Ok((command_part.trim_end(), Some(message_part.trim_start())))\n}\n\nfn parse_message_clause(clause: &str) -> Result<String> {\n    let value = clause\n        .strip_prefix(\"message=\")\n        .context(\"expected `message=` after `|`\")?;\n    parse_quoted_string(value)\n}\n\nfn parse_quoted_string(input: &str) -> Result<String> {\n    if !input.starts_with('\"') {\n        bail!(\"message must start with a double quote\");\n    }\n\n    let mut output = String::new();\n    let mut escaped = false;\n    for (index, ch) in input.char_indices().skip(1) {\n        if escaped {\n            let resolved = match ch {\n                '\\\\' => '\\\\',\n                '\"' => '\"',\n                'n' => '\\n',\n                'r' => '\\r',\n                't' => '\\t',\n                other => bail!(\"unsupported escape sequence '\\\\{other}'\"),\n            };\n            output.push(resolved);\n            escaped = false;\n            continue;\n        }","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs#L163-L199","documentation":"Inline messages in `squash` steps are parsed by `parse_message_clause` -> `parse_quoted_string`, which requires the value after `message=` to be a double-quoted string. This error is raised when the character immediately following `message=` is not `\"` (e.g. `message=hello` or `message='hello'`). It surfaces wrapped as `line N: invalid squash message: message must start with a double quote`.","triggerScenarios":"Calling parse_integration_steps_script with a squash line like `squash a b | message=unquoted` or `squash a b | message='single quoted'`. Any content after `|` that does not start with `message=\"` may also trip the earlier `expected message=` context error.","commonSituations":"Users type a message without quotes, use single quotes (shell habit), or forget the quotes after deleting part of the clause while editing.","solutions":["Wrap the message in double quotes: `squash a b | message=\"my message\"`.","Escape inner double quotes and backslashes with `\\` (supported escapes: `\\\\`, `\\\"`, `\\n`, `\\r`, `\\t`).","Remove the `| message=...` clause entirely if the combined commit should keep the default (first) commit message."],"exampleFix":"// before (script text)\nsquash 2222222 3333333 | message=combined\n// after\nsquash 2222222 3333333 | message=\"combined\"\n","handlingStrategy":"validation","validationCode":"function validateMessageClause(line: string, lineNo: number): string | null {\n  const m = line.match(/\\|\\s*message=(.)/);\n  if (m && m[1] !== '\"') return `line ${lineNo}: message must start with a double quote`;\n  return null;\n}","typeGuard":"const messageIsDoubleQuoted = (line: string): boolean => {\n  const m = line.match(/\\|\\s*message=(.)/);\n  return !m || m[1] === '\"';\n};","tryCatchPattern":"try {\n  const steps = await parseIntegrationScript(script, divergence);\n} catch (err) {\n  if (/invalid squash message: message must start with a double quote/.test(String(err))) {\n    showEditorHint('wrap squash messages in double quotes: message=\"text\"');\n  } else throw err;\n}","preventionTips":["Always use double quotes after `message=`, never bare text or single quotes.","Escape inner double quotes as `\\\"` rather than switching to single quotes.","Generate the clause with the same quoting helper the renderer uses to guarantee round-trip."],"tags":["parsing","script-validation","quoting","git"],"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"}