GitoxideLabs/gitoxide · error

HEAD is not present in the default Tix view

Error message

HEAD is not present in the default Tix view

What it means

Relative time travel computes candidates from the commits visible in the default Tix view (stored commits minus those hidden behind hidden tips). If HEAD itself is not in that filtered set, relative navigation is meaningless, so relative_destination bails. This usually means HEAD is hidden or outside the tracked history.

Solutions

  1. Unhide the relevant revision or adjust hidden tips (tix hide/show configuration) so HEAD is visible
  2. Attach HEAD to a branch that is part of the default view before travelling
  3. Use an absolute OID destination instead of a relative one

Example fix

// before
tix travel ^        # HEAD hidden in view
// after
tix unhide <hidden-tip>
tix travel ^
Defensive patterns

Strategy: validation

Validate before calling

// Ensure HEAD is visible before relative travel
let hidden = crate::history::available_hidden_revisions(&repo, &[], true)?.0;
let visible = graph.stored_commit_ids()
    .filter(|id| !hidden_tips.iter().any(|h| graph.is_ancestor(*id, *h)))
    .any(|id| id == head_id);
if !visible { /* unhide or use absolute OID */ }

Try / catch

if let Err(e) = travel("^") {
    if e.to_string().contains("not present in the default Tix view") {
        travel_absolute(head_parent_oid())?;
    } else { return Err(e); }
}

Prevention

When it happens

Trigger: Calling `tix travel` with a relative destination while head_id fails the stored.contains(&head) check — HEAD is an ancestor of a hidden tip or absent from graph.stored_commit_ids().

Common situations: HEAD detached onto a hidden/experimental commit; history view configured to hide the current line; change-id tracking not covering HEAD's branch.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08). Data as JSON: /api/errors/f58367161bd82ceb. Report an issue: GitHub.

Appendix: source

Thrown at gix-tix/src/command/travel.rs:146

        }
    }
    Ok(())
}

fn relative_destination(
    repository: &gix::Repository,
    graph: &crate::history::HistoryGraph,
    hidden_tips: &[gix::ObjectId],
    head: gix::ObjectId,
    to: To,
) -> Result<gix::ObjectId> {
    let order = graph
        .stored_commit_ids()
        .filter(|id| !hidden_tips.iter().any(|hidden| graph.is_ancestor(*id, *hidden)))
        .collect::<Vec<_>>();
    let stored = order.iter().copied().collect::<HashSet<_>>();
    if !stored.contains(&head) {
        anyhow::bail!("HEAD is not present in the default Tix view");
    }

    let candidates = match to {
        To::Parent => visible_parents(graph, head, &stored),
        To::Child => order
            .iter()
            .copied()
            .filter(|id| graph.parents_of(*id).is_some_and(|parents| parents.contains(&head)))
            .collect(),
        To::First => first_candidates(graph, head, &stored, &order),
        To::Tip => terminal_candidates(head, &children_by_parent(graph, &stored, &order), &order),
    };
    match candidates.as_slice() {
        [candidate] => Ok(*candidate),
        [] => anyhow::bail!("HEAD has no {} in the default Tix view", to.name()),
        candidates => {
            let candidates = candidates
                .iter()

View on GitHub (pinned to e73179060b)