{"record":{"id":"13b73fd90b7af2e9","repo":"GitoxideLabs/gitoxide","slug":"json-output-isn-t-implemented-yet-13b73f","errorCode":null,"errorMessage":"JSON output isn't implemented yet","messagePattern":"JSON output isn't implemented yet","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/repository/worktree.rs","lineNumber":9,"sourceCode":"use anyhow::bail;\nuse gix::prelude::ObjectIdExt;\nuse unicode_width::UnicodeWidthStr;\n\nuse crate::OutputFormat;\n\npub fn list(repo: gix::Repository, out: &mut dyn std::io::Write, format: OutputFormat) -> anyhow::Result<()> {\n    if format != OutputFormat::Human {\n        bail!(\"JSON output isn't implemented yet\");\n    }\n    let main_repo = repo.main_repo()?;\n    let mut worktrees = Vec::new();\n\n    if let Some(worktree) = main_repo.worktree() {\n        worktrees.push(create_worktree_info(&main_repo, gix::path::realpath(worktree.base())?)?);\n    }\n\n    for proxy in main_repo.worktrees()? {\n        let base = gix::path::realpath(proxy.base()?)?;\n\n        match proxy.into_repo() {\n            Ok(worktree_repo) => {\n                worktrees.push(create_worktree_info(&worktree_repo, base)?);\n            }\n            Err(_) => {\n                worktrees.push(create_inaccessible_worktree_info(&repo, base));\n            }","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/worktree.rs#L1-L27","documentation":"`gitoxide_core::repository::worktree::list` has not implemented JSON serialization for worktree information. If `format` is anything but `OutputFormat::Human`, it bails with this message before inspecting any worktrees. The error signals an unimplemented feature rather than invalid input.","triggerScenarios":"Calling `worktree::list(repo, out, OutputFormat::Json)`, or running `gix worktree list --format json` (any non-Human format) via the CLI.","commonSituations":"Automating worktree inventories and expecting JSON like other list subcommands; CI scripts that uniformly request JSON output; wrappers built before verifying format support.","solutions":["Use `OutputFormat::Human` / omit the format flag for `worktree list`.","Enumerate worktrees via the `gix` library (`repo.main_repo()?.worktree()`, `$GIT_DIR/worktrees`) and serialize yourself.","Parse the tabular human output in your tooling as an interim measure.","Contribute or wait for JSON implementation upstream in gitoxide-core."],"exampleFix":"// before\ncore::repository::worktree::list(repo, &mut out, OutputFormat::Json)?;\n// after\ncore::repository::worktree::list(repo, &mut out, OutputFormat::Human)?;","handlingStrategy":"validation","validationCode":"if format != OutputFormat::Human { format = OutputFormat::Human; // worktree list JSON is not implemented }","typeGuard":"fn worktree_json_available(f: &OutputFormat) -> bool { matches!(f, OutputFormat::Human) }","tryCatchPattern":"match worktree::list(&repo, &mut out, format) { Err(e) if e.to_string().contains(\"JSON output isn't implemented\") => worktree::list(&repo, &mut out, OutputFormat::Human), other => other }","preventionTips":["Do not pass JSON format flags to `gix worktree list` until implemented upstream.","Enumerate worktrees via the gix library for structured data needs.","Add a CI check that scripts only use formats the target gitoxide version supports."],"tags":["cli","json","output-format","worktree","git"],"backgroundTag":"method-not-implemented","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}