{"record":{"id":"cfc9100d8e01fae2","repo":"gitbutlerapp/gitbutler","slug":"line-line-number-invalid-pick-commit-err","errorCode":null,"errorMessage":"line {line_number}: invalid pick commit: {err}","messagePattern":"line (.+?): invalid pick commit: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs","lineNumber":56,"sourceCode":"            continue;\n        };\n        let arguments = tokens.get(1..).unwrap_or_default();\n\n        let step = match command {\n            \"pick\" => {\n                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                    })?,","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs#L38-L74","documentation":"Thrown while parsing an edited interactive integration script when a 'pick' line names a commit that cannot be resolved against the set of editable candidate commits derived from the integration divergence. resolve_commit fails because the token is not an unambiguous abbreviation of one of the allowed commits.","triggerScenarios":"parse_integration_steps_script encountering a line 'pick <commit>' where the commit argument fails resolve_commit: unknown commit, too-short/ambiguous short hash, hash not among allowed candidate commits, or a typo introduced while editing the todo script in the editor.","commonSituations":"Hand-editing the integration todo file and mistyping a hash; using a short hash that matches nothing or multiple candidate commits; referencing a commit not part of the upstream divergence being integrated; copying lines between different integration sessions.","solutions":["Correct the commit argument on the reported line to the short hash of a commit listed in the divergence display.","Use the full commit hash copied from the rendered script (render_integration_steps_script output) instead of a hand-typed abbreviation.","Remove the invalid pick line if the commit is not needed.","Programmatically validate hashes against editable_candidate_commits before saving the edited script."],"exampleFix":"// before: edited script\npick abc12            // ambiguous short hash\n// after\npick abc123def4567890abcdef1234567890abcdef12  // full hash of an allowed commit","handlingStrategy":"validation","validationCode":"// before saving an edited script, verify every pick hash resolves\nfn valid_pick(line: &str, allowed: &HashSet<String>) -> bool {\n    let tok = line.split_whitespace().nth(1).unwrap_or(\"\");\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 pick commit\") => {\n        // reopen the editor with the original rendered script and the error shown\n        reopen_editor_with_error_note(&e.to_string())?;\n    }\n    other => other?,\n}","preventionTips":["Copy hashes from the rendered todo script instead of typing them.","Use full hashes when hand-editing to avoid ambiguity.","Only reference commits shown in the divergence display.","Re-run the parser after each edit to fail fast at the offending line."],"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"}