{"record":{"id":"83e4056b213eeded","repo":"GitoxideLabs/gitoxide","slug":"to-is-ambiguous-candidates-candidates-t","errorCode":null,"errorMessage":"--to {} is ambiguous; candidates:\n  {candidates}\ntravel to one directly with `tix travel REVSPEC`","messagePattern":"--to (.+?) is ambiguous; candidates:\n  (.+?)\ntravel to one directly with `tix travel REVSPEC`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/command/travel.rs","lineNumber":168,"sourceCode":"        To::Parent => visible_parents(graph, head, &stored),\n        To::Child => order\n            .iter()\n            .copied()\n            .filter(|id| graph.parents_of(*id).is_some_and(|parents| parents.contains(&head)))\n            .collect(),\n        To::First => first_candidates(graph, head, &stored, &order),\n        To::Tip => terminal_candidates(head, &children_by_parent(graph, &stored, &order), &order),\n    };\n    match candidates.as_slice() {\n        [candidate] => Ok(*candidate),\n        [] => anyhow::bail!(\"HEAD has no {} in the default Tix view\", to.name()),\n        candidates => {\n            let candidates = candidates\n                .iter()\n                .map(|id| crate::change_id::display_short(repository, *id))\n                .collect::<Result<Vec<_>>>()?\n                .join(\"\\n  \");\n            anyhow::bail!(\n                \"--to {} is ambiguous; candidates:\\n  {candidates}\\ntravel to one directly with `tix travel REVSPEC`\",\n                to.name()\n            )\n        }\n    }\n}\n\nfn visible_parents(\n    graph: &crate::history::HistoryGraph,\n    id: gix::ObjectId,\n    stored: &HashSet<gix::ObjectId>,\n) -> Vec<gix::ObjectId> {\n    graph\n        .parents_of(id)\n        .unwrap_or_default()\n        .into_iter()\n        .filter(|parent| stored.contains(parent))\n        .collect()","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/command/travel.rs#L150-L186","documentation":"The `--to` flag of `tix edit --to` was given a change-id spec that matches more than one commit candidate, so the edit target is ambiguous. The tix command refuses to guess and lists all matching candidates by short change-id. It tells the user to disambiguate by using `tix travel REVSPEC` to land directly on the intended commit first.","triggerScenarios":"Running an edit-style command with `--to <name>` where `name` resolves via `crate::change_id` to 2+ commits (e.g. a partial change-id prefix or a spec matching several commits) in `relative_destination`, called from `run`.","commonSituations":"Typing an abbreviated change-id prefix that is no longer unique as new commits were created; reusing similar branch/spec names; having stacked commits from the same change that all match the spec.","solutions":["Use `tix travel REVSPEC` to move to the exact intended commit, then run the edit command without `--to`.","Extend the `--to` value (longer change-id prefix or more specific spec) so it matches exactly one candidate.","Inspect the printed candidate list and pick the correct one explicitly."],"exampleFix":"// before\ntix edit --to ab12 fix\n// after (ab12abcd and ab12efgh both match)\ntix travel ab12abcd && tix edit fix","handlingStrategy":"validation","validationCode":"let candidates = resolve_change_id_candidates(&repository, &to)?;\nif candidates.len() > 1 {\n    eprintln!(\"--to {} is ambiguous ({} candidates); use tix travel to pick one\", to.name(), candidates.len());\n    return Ok(());\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"is ambiguous\") => eprintln!(\"extend the --to spec to a unique change-id\"),\n    other => other?,\n}","preventionTips":["Use full change-ids for `--to` instead of short prefixes in scripts.","Run `tix travel REVSPEC` first so the current commit is unambiguous.","Check candidate counts programmatically before passing user input to `--to`."],"tags":["cli","ambiguity","git"],"backgroundTag":"invalid-argument-value","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}