{"record":{"id":"fb8043e65f2fcd4b","repo":"GitoxideLabs/gitoxide","slug":"json-output-isn-t-implemented-yet-fb8043","errorCode":null,"errorMessage":"JSON output isn't implemented yet","messagePattern":"JSON output isn't implemented yet","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/repository/merge/tree.rs","lineNumber":45,"sourceCode":"    pub fn tree(\n        mut repo: gix::Repository,\n        out: &mut dyn std::io::Write,\n        err: &mut dyn std::io::Write,\n        base: BString,\n        ours: BString,\n        theirs: BString,\n        Options {\n            format,\n            file_favor,\n            tree_favor,\n            in_memory,\n            debug,\n            message,\n            update_head,\n        }: Options,\n    ) -> anyhow::Result<()> {\n        if format != OutputFormat::Human {\n            bail!(\"JSON output isn't implemented yet\");\n        }\n        if update_head && in_memory {\n            bail!(\"`--update-head` cannot be used with `--in-memory` - cannot set head to nothing\");\n        }\n        if update_head && message.is_none() {\n            bail!(\"`--update-head` requires `--message`\");\n        }\n        repo.object_cache_size_if_unset(repo.compute_object_cache_size_for_tree_diffs(&**repo.index_or_empty()?));\n        if in_memory || message.is_some() {\n            repo.objects.enable_object_memory();\n        }\n        let (base_ref, base_id) = refname_and_tree(&repo, base)?;\n        let (ours_ref, ours_id) = refname_and_tree(&repo, ours)?;\n        let (theirs_ref, theirs_id) = refname_and_tree(&repo, theirs)?;\n\n        let options = repo\n            .tree_merge_options()?\n            .with_file_favor(file_favor)","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/merge/tree.rs#L27-L63","documentation":"`gix merge tree` only supports human output; a non-Human OutputFormat raises this bail immediately. Additionally the same function enforces related option rules, but this specific error is purely the format gate.","triggerScenarios":"Running `gix merge tree --format json ...`; the `format != OutputFormat::Human` check bails before validating `--update-head`/`--in-memory`/`--message` combinations.","commonSituations":"Scripted tree merges wanting JSON output; sharing one `--format` flag across subcommands; automation parsing merge results.","solutions":["Use the default human output format","Parse the human/debug output instead (conflicts are dumped with `{:#?}`)","Implement or request JSON support upstream"],"exampleFix":"// before\n$ gix merge tree --format json ours theirs\n// after\n$ gix merge tree ours theirs","handlingStrategy":"validation","validationCode":"if format != OutputFormat::Human {\n    // use human output for merge tree\n}\n","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"JSON output isn't implemented\") =>\n        eprintln!(\"re-run with human output\"),\n    other => other?,\n}\n","preventionTips":["Default to human output for merge tree","Don't propagate a global --format=json setting to this subcommand"],"tags":["cli","unsupported-format","json"],"backgroundTag":"unsupported-enum-value","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"}