{"record":{"id":"a25b7e50e9c57ac5","repo":"GitoxideLabs/gitoxide","slug":"exactly-one-time-travel-destination-is-required","errorCode":null,"errorMessage":"exactly one time-travel destination is required","messagePattern":"exactly one time-travel destination is required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/command/travel.rs","lineNumber":67,"sourceCode":"\npub(super) fn run(repository: gix::Repository, args: Args) -> Result<()> {\n    let head = repository.head().context(\"could not read HEAD before time-travel\")?;\n    let head_id = head\n        .id()\n        .map(gix::Id::detach)\n        .context(\"cannot time-travel from an unborn HEAD\")?;\n    let detached = head.is_detached();\n    drop(head);\n    let (selected, resolved_graph) = match (&args.revision, args.to) {\n        (Some(revision), None) => super::resolve_commit(&repository, revision, \"time-travel destination\")?,\n        (None, Some(to)) => {\n            let hidden = crate::history::available_hidden_revisions(&repository, &[], true)?.0;\n            let hidden_tips = crate::history::snapshot(&repository, &[], &hidden, false)?.hidden_tips;\n            let graph = crate::edit::loaded_view_graph_with_hidden(&repository, &[], &hidden)?;\n            let selected = relative_destination(&repository, &graph, &hidden_tips, head_id, to)?;\n            (selected, Some(graph))\n        }\n        _ => anyhow::bail!(\"exactly one time-travel destination is required\"),\n    };\n    if selected == head_id {\n        println!(\"already at {}\", crate::change_id::display(&repository, selected, 7)?);\n        return Ok(());\n    }\n\n    let revisions = vec![OsString::from(\"HEAD\"), OsString::from(selected.to_string())];\n    let graph = match resolved_graph {\n        Some(graph) => graph,\n        None => crate::edit::loaded_view_graph_with(&repository, &revisions)?,\n    };\n    let forward = graph.is_ancestor(head_id, selected);\n    if detached && !forward {\n        let source_is_pinned = crate::history::all_pins(&repository)?\n            .into_iter()\n            .any(|pin| graph.is_ancestor(head_id, pin.id));\n        if !source_is_pinned {\n            anyhow::bail!(","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/command/travel.rs#L49-L85","documentation":"`tix travel` accepts exactly one destination argument (absolute OID or relative spec like ^, ~, first, tip). Passing zero or multiple destinations makes the request ambiguous, so run() bails before performing any time travel.","triggerScenarios":"Invoking `tix travel` with no `to` target, or with more than one destination such that the argument match falls through to the `_` arm in run().","commonSituations":"Copy-pasting multiple OIDs; script variable expanding empty or containing spaces producing two args; forgetting the destination entirely.","solutions":["Pass exactly one destination: an OID or a relative target (e.g. `^`, `~2`, `first`, `tip`)","Quote variables in shell scripts so an empty value yields zero args deliberately and OIDs stay one argument","Check `tix log`/`tix history` for the correct single target first"],"exampleFix":"// before\ntix travel $A $B\n// after\ntix travel \"$A\"","handlingStrategy":"validation","validationCode":"// Validate destination count before invoking\nlet dests: Vec<&str> = args.to.iter().collect();\nif dests.len() != 1 {\n    return Err(anyhow!(\"pass exactly one travel destination\"));\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = run_travel(args) {\n    if e.to_string().contains(\"exactly one time-travel destination\") {\n        eprintln!(\"usage: tix travel <oid|^|~|first|tip>\");\n    }\n}","preventionTips":["Quote shell variables to avoid word-splitting into multiple args","Default empty destination variables to an explicit value like HEAD","Use a wrapper that enforces one positional argument"],"tags":["cli","time-travel","arguments"],"backgroundTag":"missing-required-argument","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}