GitoxideLabs/gitoxide · error

The spec isn't currently supported

Error message

The spec isn't currently supported: {spec:?}

What it means

The given revision `Spec` parses but its kind is not implemented by `commitgraph list`. Range specs work; `Exclude`, `Merge`, `IncludeOnlyParents`, and `ExcludeParents` variants are explicitly rejected with `bail!`.

Solutions

  1. Use a plain range spec (`from..to`) or a single rev, which are supported
  2. Enumerate commits via `commit.ancestors()` yourself and apply the exclusion/parent filtering in your code
  3. Track upstream for these spec kinds to be implemented

Example fix

// before
let spec = Spec::Exclude(head);
list(repo, spec, &mut out, false, format)?;
// after
let spec = Spec::Range { from: base, to: head };
list(repo, spec, &mut out, false, format)?;
Defensive patterns

Strategy: validation

Validate before calling

match spec {
    Spec::Exclude(_) | Spec::Merge { .. } | Spec::IncludeOnlyParents(_) | Spec::ExcludeParents(_) => {
        anyhow::bail!("spec kind unsupported by commitgraph list");
    }
    _ => {},
}

Prevention

When it happens

Trigger: Running `gix commitgraph list --exclude <rev>`, merge-base style specs, or programmatically passing `Spec::Exclude { .. }`, `Spec::Merge { .. }`, `Spec::IncludeOnlyParents(_)` or `Spec::ExcludeParents(_)` to `list`.

Common situations: Porting `git rev-list --exclude`/`--merges`/`--first-parent`-style queries to gix; scripting graph enumeration with filters git supports but gix's commitgraph list doesn't yet.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at gitoxide-core/src/repository/commitgraph/list.rs:39

            .commit_graph_if_enabled()
            .context("a commitgraph is required, but none was found")?;
        repo.object_cache_size_if_unset(4 * 1024 * 1024);
        repo.objects.refresh = RefreshMode::Never;

        let spec = gix::path::os_str_into_bstr(&spec)?;
        let spec = repo.rev_parse(spec)?.detach();
        let commits = match spec {
            Spec::Include(id) => connected_commit_id(&repo, id)?
                .ancestors()
                .sorting(Sorting::ByCommitTime(Default::default()))
                .all()?,
            Spec::Range { from, to } => connected_commit_id(&repo, to)?
                .ancestors()
                .sorting(Sorting::ByCommitTime(Default::default()))
                .with_hidden(Some(connected_commit_id(&repo, from)?))
                .all()?,
            Spec::Exclude(_) | Spec::Merge { .. } | Spec::IncludeOnlyParents(_) | Spec::ExcludeParents(_) => {
                bail!("The spec isn't currently supported: {spec:?}")
            }
        };
        for commit in commits {
            let commit = commit?;
            writeln!(
                out,
                "{} {} {} {}",
                HexId::new(commit.id(), long_hashes),
                commit.commit_time.expect("traversal with date"),
                commit.parent_ids.len(),
                graph
                    .as_ref()
                    .map_or(Cow::Borrowed(""), |graph| graph.commit_by_id(commit.id).map_or_else(
                        || Cow::Borrowed("<NOT IN GRAPH-CACHE>"),
                        |c| Cow::Owned(format!(
                            "{} {}",
                            HexId::new(c.root_tree_id().to_owned().attach(&repo), long_hashes),
                            c.generation()

View on GitHub (pinned to e73179060b)