{"record":{"id":"31ed63de46fd99e4","repo":"gitbutlerapp/gitbutler","slug":"unsupported-rev-spec-for-revision-log-other","errorCode":null,"errorMessage":"Unsupported rev-spec for revision log: {other}","messagePattern":"Unsupported rev-spec for revision log: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-debug/src/command/revision.rs","lineNumber":48,"sourceCode":"        }\n    }\n}\n\nfn log(\n    repo: &gix::Repository,\n    meta: &EmptyRefMetadata,\n    log_args: &LogArgs,\n    out: &mut dyn io::Write,\n) -> Result<()> {\n    let parsed = repo\n        .rev_parse(log_args.rev_spec.as_str())\n        .with_context(|| format!(\"Failed to parse rev-spec '{}'\", log_args.rev_spec))?\n        .detach();\n\n    let (included, excluded) = match parsed {\n        Spec::Include(commit_id) => (commit_id, None),\n        Spec::Range { from, to } => (to, Some(from)),\n        other => bail!(\"Unsupported rev-spec for revision log: {other}\"),\n    };\n    let mut graph_commits = vec![included];\n    graph_commits.extend(excluded);\n\n    let graph_tips = args_to_tips(repo, &log_args.graph)?;\n    let graph = {\n        let _span =\n            tracing::info_span!(\"build graph\", commit_count = graph_commits.len()).entered();\n        graph_for_revisions(repo, meta, &graph_commits, graph_tips)?\n    };\n\n    let _span = tracing::info_span!(\"traverse graph\").entered();\n    let commits = if let Some(excluded) = excluded {\n        graph.find_commit_ids_reachable_from_a_not_b(\n            included,\n            excluded,\n            FirstParent::from(log_args.first_parent),\n        )?","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-debug/src/command/revision.rs#L30-L66","documentation":"The revision log parser accepts only rev-specs that resolve to Spec::Include(commit_id) or Spec::Range{from,to}. Any other parsed Spec variant cannot be expressed as an (included, excluded) pair for the graph walk, so `log` bails naming the unsupported variant.","triggerScenarios":"Calling log (from run) with log_args.rev_spec that parses to a Spec variant other than Include or Range — e.g. an exclusion-only spec like `^main`, or other gix spec forms.","commonSituations":"Users passing `^branch` or `--not`-style specs, multiple revs, or ref globs to the debug revision-log command; scripts copying git log syntax that gix's spec parser models differently.","solutions":["Use a single commit id/rev (Include) or a range `a..b` (Range) as the rev-spec","Avoid exclusion-only specs like `^main`; express the intent as a range instead","Check the parsed Spec variant you get for your input and add support for it if a new form is genuinely needed"],"exampleFix":"// before\n--rev-spec \"^main\"            // unsupported variant\n// after\n--rev-spec \"feature..main\"    // Range{from: feature, to: main}","handlingStrategy":"validation","validationCode":"if !(rev_spec.contains(\"..\") || !rev_spec.starts_with('^')) {\n    anyhow::bail!(\"rev-spec must be a single rev or an a..b range\");\n}","typeGuard":null,"tryCatchPattern":"match api.log(&repo, args, &mut out) {\n    Err(e) if e.to_string().contains(\"Unsupported rev-spec\") => eprintln!(\"use a single rev or an `a..b` range\"),\n    other => other?,\n}","preventionTips":["Restrict user input to `<rev>` or `<a>..<b>` forms","Reject `^rev` / `--not` syntax before invoking the command","Handle parse errors (Failed to parse rev-spec) before reaching the match"],"tags":["cli","revision","revspec","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}