{"record":{"id":"489c1b9ba82aaae4","repo":"gitbutlerapp/gitbutler","slug":"line-line-number-invalid-squash-message-err","errorCode":null,"errorMessage":"line {line_number}: invalid squash message: {err}","messagePattern":"line (.+?): invalid squash message: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs","lineNumber":97,"sourceCode":"                    bail!(\"line {line_number}: squash requires at least two commits\");\n                }\n                let commits = arguments\n                    .iter()\n                    .map(|commit| {\n                        resolve_commit(commit, &allowed_commits).map_err(|err| {\n                            anyhow::anyhow!(\n                                \"line {line_number}: invalid squash commit '{commit}': {err}\"\n                            )\n                        })\n                    })\n                    .collect::<Result<Vec<_>>>()?;\n                InteractiveIntegrationStep::Squash {\n                    commits,\n                    message: message_part\n                        .map(parse_message_clause)\n                        .transpose()\n                        .map_err(|err| {\n                            anyhow::anyhow!(\"line {line_number}: invalid squash message: {err}\")\n                        })?,\n                }\n            }\n            other => bail!(\"line {line_number}: unknown command '{other}'\"),\n        };\n        steps.push(step);\n    }\n\n    Ok(steps)\n}\n\nfn render_step(step: &InteractiveIntegrationStep) -> String {\n    match step {\n        InteractiveIntegrationStep::Pick { commit_id } => format!(\"pick {}\", short_id(*commit_id)),\n        InteractiveIntegrationStep::Merge { commit_id } => {\n            format!(\"merge {}\", short_id(*commit_id))\n        }\n        InteractiveIntegrationStep::Squash { commits, message } => {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs#L79-L115","documentation":"Thrown while parsing an edited integration script when the optional message clause on a 'squash' line (the text after a separator, parsed by parse_message_clause) is malformed. The step's command and commits were fine, but the inline message portion does not satisfy the clause grammar (e.g. wrong quoting or empty content).","triggerScenarios":"parse_integration_steps_script encountering 'squash <c1> <c2> | <message>' (or however the message clause is delimited) where parse_message_clause rejects the message — unbalanced quotes, empty message, or an invalid clause format.","commonSituations":"Hand-editing the todo and breaking the quoting around a message with special characters; deleting the message content while keeping the clause separator; adding a message clause to a line format that expects none.","solutions":["Fix the message clause on the reported line — quote the message correctly per the script grammar (mirror the rendering in render_step).","Remove the message clause entirely to let the squash use the default combined message.","Re-copy the line from the originally rendered script and re-apply the edit carefully.","Round-trip the edit through render_integration_steps_script/parse_integration_steps_script in tests to confirm the clause grammar."],"exampleFix":"// before\nsquash a1b2c3d4... e4f5g6h7... | \"unclosed message\n// after\nsquash a1b2c3d4... e4f5g6h7... | \"properly closed message\"","handlingStrategy":"validation","validationCode":"// check the message clause quotes are balanced before saving\nfn message_clause_ok(line: &str) -> bool {\n    line.matches('\"').count() % 2 == 0\n}","typeGuard":null,"tryCatchPattern":"match parse_integration_steps_script(&edited, &divergence) {\n    Err(e) if e.to_string().contains(\"invalid squash message\") => {\n        reopen_editor_with_error_note(&e.to_string())?;\n    }\n    other => other?,\n}","preventionTips":["Match the exact message-clause format produced by render_integration_steps_script.","Quote messages containing spaces or special characters exactly as rendered.","Delete the message clause rather than leaving it empty/broken.","Round-trip render→parse in tests whenever the clause grammar changes."],"tags":["parsing","integration","validation","script"],"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"}