{"record":{"id":"bd0070e66e550636","repo":"gitbutlerapp/gitbutler","slug":"target-is-ambiguous-please-provide-more-characters-to","errorCode":null,"errorMessage":"\"{target}\" is ambiguous. Please provide more characters to uniquely identify it.","messagePattern":"\"(.+?)\" is ambiguous\\. Please provide more characters to uniquely identify it\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/resolve.rs","lineNumber":714,"sourceCode":"}\n\nenum CommitOrBranch {\n    Commit(gix::ObjectId),\n    Branch(String),\n}\n\n/// Resolve a user-provided identifier to a commit or a branch.\nfn parse_commit_or_branch(ctx: &mut Context, target: &str) -> Result<CommitOrBranch> {\n    let id_map = IdMap::legacy_new_from_context(ctx)?;\n    let matches = id_map.parse_using_context(target, ctx)?;\n    match matches.as_slice() {\n        [] => bail!(\n            \"\\\"{target}\\\" is neither a commit nor a branch. Try running 'but status' to see what is available.\"\n        ),\n        [CliId::Commit { commit, .. }] => Ok(CommitOrBranch::Commit(commit.commit_id)),\n        [CliId::Branch(branch)] => Ok(CommitOrBranch::Branch(branch.name.clone())),\n        [_] => bail!(\"\\\"{target}\\\" does not refer to a commit or a branch\"),\n        _ => bail!(\n            \"\\\"{target}\\\" is ambiguous. Please provide more characters to uniquely identify it.\"\n        ),\n    }\n}\n\n/// List the conflicts of a conflicted commit without entering resolution mode.\nfn list_conflicts(ctx: &mut Context, out: &mut OutputChannel, commit: Option<&str>) -> Result<()> {\n    let t = theme::get();\n    let Some(target) = target_conflicted_commit(ctx, commit)? else {\n        if let Some(human_out) = out.for_human() {\n            writeln!(\n                human_out,\n                \"{}\",\n                t.success.paint(\"No conflicted commits found.\")\n            )?;\n        }\n        if let Some(json_out) = out.for_json() {\n            json_out.write_value(serde_json::json!({ \"commit_id\": null, \"files\": [] }))?;","sourceCodeStart":696,"sourceCodeEnd":732,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/resolve.rs#L696-L732","documentation":"Thrown by parse_commit_or_branch when the IdMap returns more than one match for the target — the identifier is a valid prefix but is ambiguous. The user must supply more characters (or a longer name) to make it unique.","triggerScenarios":"`but resolve <prefix> ...` where the short commit-hash prefix or partial branch name matches 2+ CliIds in the workspace.","commonSituations":"Short SHAs that share a prefix; similarly named branches like feature/x and feature/x-2.","solutions":["Provide more characters of the commit hash.","Use the full branch name.","Run `but status` to see which identifiers collide."],"exampleFix":"// before\nbut resolve ab\n// after\nbut resolve ab34f9c","handlingStrategy":"validation","validationCode":"const matches = idMap.parse(target);\nif (matches.length > 1) throw new Error(`\"${target}\" is ambiguous; candidates: ${matches.map(m => m.display).join(', ')}`);","typeGuard":null,"tryCatchPattern":"try { await butResolve(prefix) } catch (e) { if (String(e).includes('ambiguous')) { listCandidates(prefix); } }","preventionTips":["Use at least 7-8 characters of a commit hash.","Prefer full branch names over prefixes.","Disambiguate similarly named branches before scripting."],"tags":["cli","git","ambiguity","invalid-argument"],"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"}