gitbutlerapp/gitbutler · error · anyhow::Error
Unsupported rev-spec for revision log: {other}
Error message
Unsupported rev-spec for revision log: {other} What it means
`but revision log` parses the rev-spec with gix and only handles two `Spec` outcomes: `Include` (single commit) and `Range` (`a..b`). Any other parsed form — e.g. `Spec::Exclude` from `..b`-style specs or other plumbing spec variants — hits this bail, printing the spec kind. The spec parsed successfully; it's the shape that's unsupported.
Source
Thrown at crates/but-debug/src/command/revision.rs:48
}
}
}
fn log(
repo: &gix::Repository,
meta: &EmptyRefMetadata,
log_args: &LogArgs,
out: &mut dyn io::Write,
) -> Result<()> {
let parsed = repo
.rev_parse(log_args.rev_spec.as_str())
.with_context(|| format!("Failed to parse rev-spec '{}'", log_args.rev_spec))?
.detach();
let (included, excluded) = match parsed {
Spec::Include(commit_id) => (commit_id, None),
Spec::Range { from, to } => (to, Some(from)),
other => bail!("Unsupported rev-spec for revision log: {other}"),
};
let mut graph_commits = vec![included];
graph_commits.extend(excluded);
let graph_tips = args_to_tips(repo, &log_args.graph)?;
let graph = {
let _span =
tracing::info_span!("build graph", commit_count = graph_commits.len()).entered();
graph_for_revisions(repo, meta, &graph_commits, graph_tips)?
};
let _span = tracing::info_span!("traverse graph").entered();
let commits = if let Some(excluded) = excluded {
graph.find_commit_ids_reachable_from_a_not_b(
included,
excluded,
FirstParent::from(log_args.first_parent),
)?View on GitHub (pinned to caf1f223d3)
Solutions
- Use an explicit range: `but revision log a..b`.
- Use a single include spec `but revision log <rev>` — but note this command additionally requires a range for the exclusion step, so prefer `a..b`.
- Check the printed `{other}` variant to see which spec shape you produced and rewrite the spec into `a..b` form.
Example fix
# before but revision log ..feature-x # after but revision log main..feature-x
Defensive patterns
Strategy: validation
Validate before calling
# Shell — accept only forms this command supports spec="$1" case "$spec" in *..*) ;; # a..b style is fine *) echo "use a..b form" >&2; exit 2 ;; esac but revision log "$spec"
Prevention
- Normalize rev-specs to `a..b` before passing them to `but revision log`.
- Don't reuse spec strings crafted for `git log`/`git rev-list` verbatim; verify each with `git rev-parse --verify <spec>` semantics first.
- Read the printed `{other}` variant — it tells you exactly which spec shape gix produced.
When it happens
Trigger: Passing a rev-spec that gix parses into a non-Include/non-Range spec, such as an exclude-only spec (`..branch`), since `revision log` only knows how to drive inclusion plus at most one exclusion.
Common situations: Muscle-memory git log syntax (`git log ..next`, `^ref` forms) carried over to `but revision log`; scripts reusing rev-specs from other git commands.
Related errors
- Need to specify a rev-spec of form `a..b` to indicate an exc
- BUG: It should not be possible to omit sources
- {} target value is required
- target kind is required when target value is provided
- Invalid source: expected an uncommitted file or branch
AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20).
Data as JSON: /api/errors/31ed63de46fd99e4.
Report an issue: GitHub.