{"record":{"id":"3148161155760b9b","repo":"gitbutlerapp/gitbutler","slug":"need-to-specify-a-rev-spec-of-form-a-b-to-indic","errorCode":null,"errorMessage":"Need to specify a rev-spec of form `a..b` to indicate an exclusion for now.","messagePattern":"Need to specify a rev-spec of form `a\\.\\.b` to indicate an exclusion for now\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-debug/src/command/revision.rs","lineNumber":68,"sourceCode":"    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        )?\n    } else {\n        bail!(\"Need to specify a rev-spec of form `a..b` to indicate an exclusion for now.\")\n    };\n\n    let mut out = io::BufWriter::new(out);\n    for commit_id in commits {\n        commit_id.write_hex_to(&mut out)?;\n        writeln!(out)?;\n    }\n    Ok(())\n}\n\nfn merge_base(\n    repo: &gix::Repository,\n    meta: &EmptyRefMetadata,\n    merge_base_args: &MergeBaseArgs,\n    out: &mut dyn io::Write,\n) -> Result<()> {\n    let commits = {\n        let _span = tracing::info_span!(","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-debug/src/command/revision.rs#L50-L86","documentation":"When the log command has an `included` commit but no `excluded` one, it can still walk reachable commits; but the current code path requires that an exclusion was provided, otherwise it bails asking for an `a..b` rev-spec. This is a stated temporary limitation of the graph walk API used (find_commit_ids_reachable_from_a_not_b).","triggerScenarios":"Calling log (from run) with a graph argument whose rev-spec resolves to Spec::Include only (no `a..b` range), so `excluded` is None and the else branch bails.","commonSituations":"Users passing a single revision like `main` when they intended `base..main`; scripts omitting the exclusion side of the range; older invocations written before the range requirement was added.","solutions":["Pass a rev-spec of the form `a..b` (e.g. `main..feature`) so the exclusion side exists","If you want all commits reachable from b without exclusion, wait for/update to a version where single-rev logs are supported, or use the gix graph API directly","Adjust scripts to always supply the base commit of the range"],"exampleFix":"// before\nbut debug log --rev-spec \"feature\"\n// after\nbut debug log --rev-spec \"main..feature\"","handlingStrategy":"validation","validationCode":"if !rev_spec.contains(\"..\") {\n    anyhow::bail!(\"supply an exclusion: use `a..b` form\");\n}","typeGuard":null,"tryCatchPattern":"match api.log(&repo, args, &mut out) {\n    Err(e) if e.to_string().contains(\"Need to specify a rev-spec of form `a..b`\") => {\n        eprintln!(\"add a base: e.g. main..feature\");\n    }\n    other => other?,\n}","preventionTips":["Always provide both sides of the range in scripts (base..tip)","Document that single-revision logs are not yet supported by this command","Validate the rev-spec contains `..` before calling log"],"tags":["cli","revision","revspec","limitation"],"backgroundTag":"invalid-argument-format","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"}