{"record":{"id":"966b448cf9388805","repo":"GitoxideLabs/gitoxide","slug":"json-output-isn-t-implemented-yet-966b44","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/clean.rs","lineNumber":60,"sourceCode":"        repo: gix::Repository,\n        out: &mut dyn std::io::Write,\n        err: &mut dyn std::io::Write,\n        patterns: Vec<BString>,\n        Options {\n            debug,\n            format,\n            mut execute,\n            ignored,\n            precious,\n            directories,\n            repositories,\n            skip_hidden_repositories,\n            find_untracked_repositories,\n            pathspec_matches_result,\n        }: Options,\n    ) -> anyhow::Result<()> {\n        if format != OutputFormat::Human {\n            bail!(\"JSON output isn't implemented yet\");\n        }\n        let Some(workdir) = repo.workdir() else {\n            bail!(\"Need a worktree to clean, this is a bare repository\");\n        };\n\n        let index = repo.index_or_empty()?;\n        let pathspec_for_dirwalk = !pathspec_matches_result;\n        let has_patterns = !patterns.is_empty();\n        let mut collect = InterruptibleCollect::default();\n        let collapse_directories = CollapseDirectory;\n        let options = repo\n            .dirwalk_options()?\n            .emit_pruned(true)\n            .for_deletion(if (ignored || precious) && directories {\n                match skip_hidden_repositories {\n                    Some(FindRepository::NonBare) => Some(FindNonBareRepositoriesInIgnoredDirectories),\n                    Some(FindRepository::All) => Some(FindRepositoriesInIgnoredDirectories),\n                    None => Some(Default::default()),","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/clean.rs#L42-L78","documentation":"The `gix clean` command refuses to produce machine-readable output. `clean` implements only the Human output format; as soon as a non-Human `OutputFormat` (JSON) is requested it aborts with `bail!` before doing any work. This is an explicit unimplemented-feature guard, not a runtime failure.","triggerScenarios":"Calling `gitoxide_core::repository::clean::clean` (or running `gix clean --format json`) with `format: OutputFormat::Json` or any format other than `Human`.","commonSituations":"Scripting the clean command expecting structured output; an agent/CI pipeline passing a uniform `--format json` flag across subcommands; copying an options struct from another subcommand that does support JSON.","solutions":["Use `OutputFormat::Human` (or omit the format flag) until JSON support lands for `clean`","Check the gitoxide changelog/releases for when `clean` gains JSON output and upgrade","Parse human output as an interim workaround, or use `gix status`/directory walk APIs directly in a custom tool"],"exampleFix":"// before\nclean(repo, options, OutputFormat::Json, progress, &mut out)?;\n// after\nclean(repo, options, OutputFormat::Human, progress, &mut out)?;","handlingStrategy":"validation","validationCode":"if format != gix::output_format::OutputFormat::Human {\n    anyhow::bail!(\"gix clean supports only human output\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't pass JSON format to subcommands not listed as JSON-capable in gix docs","Feature-test subcommand capabilities before scripting around them"],"tags":["cli","unimplemented-feature","output-format"],"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"}