GitoxideLabs/gitoxide · error · anyhow::Error
the todo cannot edit this reference namespace
Error message
the todo cannot edit this reference namespace
What it means
Namespace policy check inside `resolve_ref_name` during todo parsing. After expanding the input to a full ref name (prefixing `refs/heads/` when needed), the function rejects names falling into internal or reserved namespaces: history pin, stash, and review prefixes, the undo queue refs, and internal ref categories. These refs are managed by the tool itself, so a todo that creates, moves, or deletes them would corrupt its internal bookkeeping. Fired when a user writes a ref line targeting a reserved namespace; fix by choosing a normal branch name outside the reserved prefixes.
Solutions
- Edit the todo so it only updates ordinary branch references outside the reserved pin, stash, review, and undo-queue namespaces
- Use the full refs/heads/<name> spelling to make clear the target is a normal branch, not a hidden or managed reference
- Perform pin/stash/review queue operations through the dedicated tix commands instead of todo edit instructions
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at gix-tix/src/edit/todo.rs:1157 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/01d4f17004fd5557.
Report an issue: GitHub.
Appendix: source
Thrown at gix-tix/src/edit/todo.rs:1157
}
let full = if input.starts_with(b"refs/") {
input.to_owned()
} 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,View on GitHub (pinned to e73179060b)