{"record":{"id":"fd9a047653d7bec4","repo":"GitoxideLabs/gitoxide","slug":"cannot-print-information-using-human-format","errorCode":null,"errorMessage":"Cannot print information using 'human' format.","messagePattern":"Cannot print information using 'human' format\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/index/mod.rs","lineNumber":67,"sourceCode":"    out: impl std::io::Write,\n    mut err: impl std::io::Write,\n    information::Options {\n        index: Options {\n            object_hash,\n            mut format,\n        },\n        extension_details,\n    }: information::Options,\n) -> anyhow::Result<()> {\n    use crate::OutputFormat::*;\n    #[cfg(feature = \"serde\")]\n    if let Human = format {\n        writeln!(err, \"Defaulting to JSON printing as nothing else will be implemented.\").ok();\n        format = Json;\n    }\n    match format {\n        Human => {\n            anyhow::bail!(\"Cannot print information using 'human' format.\")\n        }\n        #[cfg(feature = \"serde\")]\n        Json => {\n            let info = information::Collection::try_from_file(parse_file(index_path, object_hash)?, extension_details)?;\n            serde_json::to_writer_pretty(out, &info)?;\n            Ok(())\n        }\n    }\n}\n","sourceCodeStart":49,"sourceCodeEnd":77,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/index/mod.rs#L49-L77","documentation":"Thrown by the index information printer (`index::information`) when the output format is `human`. Human formatting was never implemented for index info - the code warns and falls back to JSON first, so a `Human` value reaching the match is a logic hole and bails defensively.","triggerScenarios":"Calling the index information function with `OutputFormat::Human`; in practice only reachable if the pre-match fallback is bypassed or format changes since the fallback happens before the match.","commonSituations":"Passing `--format human` (or omitting an explicit JSON selection where defaults change) for the `gix index information` command and expecting human-readable output.","solutions":["Use JSON output format instead - it is the only supported format","Pass `--format json` (or equivalent) on the CLI","In code, pass `OutputFormat::Json` explicitly"],"exampleFix":"// before\ngix index information --format human ./index\n// after\ngix index information --format json ./index","handlingStrategy":"fallback","validationCode":"// Only Json is supported for index information\nlet format = if format == OutputFormat::Human {\n    OutputFormat::Json\n} else {\n    format\n};","typeGuard":null,"tryCatchPattern":"match index::information(/* args, format */) {\n    Ok(()) => (),\n    Err(e) if e.to_string().contains(\"Cannot print information using 'human' format\") => {\n        // retry with JSON\n        index::information(/* args, OutputFormat::Json */)?;\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always request JSON format for index information output","Update scripts that pass --format human to this subcommand","Check command documentation for which output formats are implemented"],"tags":["git","cli","output-format","unsupported"],"backgroundTag":"unsupported-operation","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"}