{"record":{"id":"ab364f598dc0d767","repo":"GitoxideLabs/gitoxide","slug":"json-output-isn-t-implemented-yet-ab364f","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/exclude.rs","lineNumber":34,"sourceCode":"        pub show_ignore_patterns: bool,\n        pub statistics: bool,\n    }\n}\n\npub fn query(\n    repo: gix::Repository,\n    input: PathsOrPatterns,\n    mut out: impl io::Write,\n    mut err: impl io::Write,\n    query::Options {\n        overrides,\n        format,\n        show_ignore_patterns,\n        statistics,\n    }: query::Options,\n) -> anyhow::Result<()> {\n    if format != OutputFormat::Human {\n        bail!(\"JSON output isn't implemented yet\");\n    }\n\n    let index = repo.index()?;\n    let mut cache = repo.excludes(\n        &index,\n        Some(gix::ignore::Search::from_overrides(\n            overrides,\n            repo.ignore_pattern_parser()?,\n        )),\n        Default::default(),\n    )?;\n\n    let paths: Box<dyn Iterator<Item = gix::bstr::BString>> = match input {\n        PathsOrPatterns::Paths(paths) => paths,\n        PathsOrPatterns::Patterns(paths) => Box::new(paths.into_iter()),\n    };\n    for path in paths {\n        let mode = gix::path::from_bstr(Cow::Borrowed(path.as_ref()))","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/exclude.rs#L16-L52","documentation":"The `exclude query` command checks which paths are excluded/ignored, but only the human output format is implemented. Requesting JSON output throws this error because JSON serialization of exclude query results does not exist yet.","triggerScenarios":"Calling `query` in gitoxide-core/src/repository/exclude.rs with `format != OutputFormat::Human`, e.g. `gix exclude query --format json`.","commonSituations":"CI or tooling that wants machine-readable ignore-check results; developers copying `--format json` from subcommands that do support it.","solutions":["Use the default human format (omit the format flag or pass `human`)","Parse the human output if automation is required (fragile)","Implement or request JSON support for the exclude subcommand"],"exampleFix":"// before\nexclude::query(repo, query::Options { format: OutputFormat::Json, .. })?;\n// after\nexclude::query(repo, query::Options { format: OutputFormat::Human, .. })?;","handlingStrategy":"validation","validationCode":"if format != OutputFormat::Human {\n    eprintln!(\"exclude query only supports human output\");\n    format = OutputFormat::Human;\n}","typeGuard":null,"tryCatchPattern":"match exclude::query(repo, options) {\n    Err(e) if e.to_string().contains(\"JSON output\") => {\n        exclude::query(repo, options_with_human_format)?\n    }\n    other => other?,\n}","preventionTips":["Only pass --format json where supported","Check subcommand help for format support","Default to OutputFormat::Human for exclude queries"],"tags":["cli","exclude","not-implemented"],"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-16T04:17:20.429Z"}