GitoxideLabs/gitoxide · error · anyhow::Error

the todo cannot edit a hidden reference

Error message

the todo cannot edit a hidden reference

What it means

Visibility check inside `resolve_ref_name` during todo parsing. Hidden references (tool-internal or filtered-out refs, e.g. hidden tags/categories configured by the app) are excluded from editing; a todo line naming such a ref bails so hidden bookkeeping refs cannot be moved or deleted through an edited plan. Distinct from the namespace guard: the ref may be in a normal namespace but is currently hidden from the user's view. Fix by unhiding the reference in the tool's settings or editing a visible branch instead.

Solutions

  1. Remove the todo line that targets the hidden reference (tag, hidden branch, or other non-editable category)
  2. Point the edit at a regular refs/heads/ branch that the todo is allowed to modify
  3. Re-run the todo edit after correcting or deleting the offending reference entry
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at gix-tix/src/edit/todo.rs:1160 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at gix-tix/src/edit/todo.rs:1160

    } else {
        let mut full = BString::from("refs/heads/");
        full.extend_from_slice(input);
        full
    };
    let name = gix::refs::FullName::try_from(full).context("the todo contains an invalid reference name")?;
    if name.as_bstr().starts_with(crate::history::PIN_PREFIX)
        || name.as_bstr().starts_with(crate::history::STASH_PREFIX)
        || name.as_bstr().starts_with(crate::history::REVIEW_PREFIX)
        || super::undo::is_queue_ref(name.as_bstr())
        || matches!(
            name.category(),
            Some(gix::refs::Category::Tag | gix::refs::Category::RemoteBranch)
        )
    {
        anyhow::bail!("the todo cannot edit this reference namespace");
    }
    if refs.iter().any(|reference| reference.name == name) {
        anyhow::bail!("the todo cannot edit a hidden reference");
    }
    let old = repo
        .try_find_reference(name.as_ref())?
        .map(|reference| {
            reference
                .try_id()
                .map(gix::Id::detach)
                .context("an existing symbolic reference outside the editable history cannot be moved")
        })
        .transpose()?;
    refs.push(rebase::ExpectedRef {
        name: name.clone(),
        old,
        target: old.unwrap_or(repo.head_id()?.detach()),
        new: old,
        follows_tip: false,
        editable: true,
        placement: None,

View on GitHub (pinned to e73179060b)