{"record":{"id":"98b1ef80aa80a59f","repo":"gitbutlerapp/gitbutler","slug":"line-line-number-squash-requires-at-least-two-c","errorCode":null,"errorMessage":"line {line_number}: squash requires at least two commits","messagePattern":"line (.+?): squash requires at least two commits","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs","lineNumber":79,"sourceCode":"                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                }\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}\")","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs#L61-L97","documentation":"Raised by `parse_integration_steps_script` when a `squash` line lists fewer than two commit specs. Squash exists solely to combine multiple commits, so a single-commit squash is rejected at parse time.","triggerScenarios":"Script line `squash 4f2a9c1` (one commit) or `squash` (none). Often the result of a user deleting one of the commits from a pre-filled squash group.","commonSituations":"User removes a commit from a squash group the proposal generated, leaving one behind; or intends 'squash into nothing' semantics that the model doesn't have.","solutions":["Keep at least two commits on the line: `squash 4f2a9c1 991b3aa`.","If only one commit should remain, replace the squash line with `pick <sha>`.","If the group should vanish entirely, delete the whole line."],"exampleFix":"# before\nsquash 4f2a9c1\n\n# after\npick 4f2a9c1","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"if let Err(err) = parse_integration_steps_script(&script, &divergence) {\n    // 'line {n}: squash requires at least two commits'\n    // suggest replacing the line with 'pick <sha>' or deleting it\n}","preventionTips":["When the UI lets users remove commits from a squash group, auto-collapse groups of 1 into a pick line.","Validate the script with the parser before integration."],"tags":["rust","git","but-workspace","integration","todo-script","parsing","squash"],"backgroundTag":"rebase-todo-parse-error","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}