{"record":{"id":"dc0a055d65592cde","repo":"GitoxideLabs/gitoxide","slug":"only-human-format-is-currently-supported-dc0a05","errorCode":null,"errorMessage":"Only 'human' format is currently supported","messagePattern":"Only 'human' format is currently supported","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/repository/merge_base.rs","lineNumber":13,"sourceCode":"use anyhow::bail;\n\nuse crate::OutputFormat;\n\npub fn merge_base(\n    mut repo: gix::Repository,\n    first: String,\n    others: Vec<String>,\n    mut out: impl std::io::Write,\n    format: OutputFormat,\n) -> anyhow::Result<()> {\n    if format != OutputFormat::Human {\n        bail!(\"Only 'human' format is currently supported\");\n    }\n    repo.object_cache_size_if_unset(50 * 1024 * 1024);\n    let first_id = commit_id(&repo, first.as_str())?;\n    let other_ids: Vec<_> = others\n        .iter()\n        .map(|other| commit_id(&repo, other.as_str()))\n        .collect::<Result<_, _>>()?;\n\n    let cache = repo.commit_graph_if_enabled()?;\n    let mut graph = repo.revision_graph(cache.as_ref());\n    let bases = repo.merge_bases_many_with_graph(first_id, &other_ids, &mut graph)?;\n    if bases.is_empty() {\n        bail!(\"No base found for {first} and {others}\", others = others.join(\", \"))\n    }\n    for id in bases {\n        writeln!(&mut out, \"{id}\")?;\n    }\n    Ok(())","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/merge_base.rs#L1-L31","documentation":"The `gix repo merge-base` command only implements human-readable output (one base id per line). If any other `OutputFormat` (e.g. JSON) is requested, it bails with this message because the formatter was never implemented.","triggerScenarios":"Calling `merge_base()` in gitoxide-core/src/repository/merge_base.rs with `format != OutputFormat::Human`.","commonSituations":"Scripts passing a global `--format json` flag for machine parsing; callers assuming every gitoxide subcommand supports JSON output.","solutions":["Use the default human format and parse the printed object ids.","Parse the commit ids from stdout lines instead of relying on structured output.","Request/implement JSON support in `merge_base` if structured output is required."],"exampleFix":"// before\ngix repo merge-base --format json HEAD feature\n// after\ngix repo merge-base HEAD feature  # one id per line","handlingStrategy":"validation","validationCode":"if format != OutputFormat::Human {\n    eprintln!(\"merge-base supports human output only\");\n    format = OutputFormat::Human; // or refuse early\n}","typeGuard":null,"tryCatchPattern":"match merge_base(repo, first, others, out, format) {\n    Err(e) if e.to_string().contains(\"Only 'human' format\") => fallback_to_human_parsing(),\n    r => r?,\n}","preventionTips":["Don't pass structured-output flags to subcommands that only implement human output.","Parse one-object-id-per-line output with your language's line splitter.","Check the subcommand's help text for supported formats before scripting."],"tags":["cli","output-format","json","gitoxide"],"backgroundTag":"unsupported-operation","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}