{"record":{"id":"4cd4a5ee0b1eacc3","repo":"gitbutlerapp/gitbutler","slug":"line-line-number-invalid-squash-commit-commit","errorCode":null,"errorMessage":"line {line_number}: invalid squash commit '{commit}': {err}","messagePattern":"line (.+?): invalid squash commit '(.+?)': (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs","lineNumber":85,"sourceCode":"                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}\")\n                        })?,\n                }\n            }\n            other => bail!(\"line {line_number}: unknown command '{other}'\"),\n        };\n        steps.push(step);","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs#L67-L103","documentation":"Thrown while parsing an edited integration script when one of the two-or-more commits on a 'squash' line cannot be resolved against the allowed candidate commits. Each argument on a squash line is resolved individually, and the failing token is named in the message.","triggerScenarios":"parse_integration_steps_script encountering a 'squash <c1> <c2> ...' line where any single argument fails resolve_commit (unknown, ambiguous, or not an allowed candidate commit).","commonSituations":"Hand-editing a squash line and dropping a character from a hash; adding a new commit to a squash line by typing its short hash from memory; referencing commits outside the current divergence's editable set.","solutions":["Correct the offending commit token (named in the error) to an unambiguous hash of an allowed commit.","Re-copy all hashes on the line from the originally rendered script.","Remove the bad commit from the squash line or split the line if the commit is not needed.","Validate each hash against editable_candidate_commits before saving the edited script."],"exampleFix":"// before\nsquash 1a2b3c4 1a2b3c   // second hash ambiguous\n// after\nsquash 1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b 0f1e2d3c4b5a6978879685949382917060594837","handlingStrategy":"validation","validationCode":"// validate every commit token on squash lines before saving\nfn valid_squash(line: &str, allowed: &HashSet<String>) -> bool {\n    line.split_whitespace()\n        .skip(1)\n        .all(|tok| tok == \"|\" || tok.starts_with('\"')\n            || allowed.iter().any(|c| c.starts_with(tok) && tok.len() >= 4))\n}","typeGuard":null,"tryCatchPattern":"match parse_integration_steps_script(&edited, &divergence) {\n    Err(e) if e.to_string().contains(\"invalid squash commit\") => {\n        // the message names the bad token; reopen the editor highlighting it\n        reopen_editor_with_error_note(&e.to_string())?;\n    }\n    other => other?,\n}","preventionTips":["Edit squash lines by duplicating existing hashes rather than typing new ones.","Use full hashes for every commit in a squash line.","Verify each added commit belongs to the editable candidate set.","Parse-validate the script immediately after each edit."],"tags":["parsing","git","integration","validation"],"backgroundTag":"invalid-argument-value","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"}