{"record":{"id":"13bd4421b3d4d4e0","repo":"GitoxideLabs/gitoxide","slug":"only-human-output-format-is-supported-at-the-momen","errorCode":null,"errorMessage":"Only human output format is supported at the moment","messagePattern":"Only human output format is supported at the moment","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/repository/config.rs","lineNumber":15,"sourceCode":"use anyhow::{Context, Result, bail};\nuse gix::{bstr::BString, config::AsKey};\nuse std::io::Write as _;\n\nuse crate::OutputFormat;\n\n/// List all files which contributed sections to the resolved configuration, in precedence order.\npub fn list_files(\n    repo: gix::Repository,\n    overrides: Vec<BString>,\n    format: OutputFormat,\n    mut out: impl std::io::Write,\n) -> Result<()> {\n    if format != OutputFormat::Human {\n        bail!(\"Only human output format is supported at the moment\");\n    }\n    let repo = gix::open_opts(repo.git_dir(), repo.open_options().clone().cli_overrides(overrides))?;\n    let config = repo.config_snapshot();\n    let mut seen = std::collections::BTreeSet::new();\n    for meta in config.sections().map(|section| section.meta()).chain([config.meta()]) {\n        let Some(path) = meta.path.as_ref() else {\n            continue;\n        };\n        if seen.insert(path) {\n            if meta.level == 0 {\n                writeln!(out, \"{}\\t{{ source={:?} }}\", path.display(), meta.source)?;\n            } else {\n                writeln!(\n                    out,\n                    \"{}\\t{{ source={:?}, include-level={} }}\",\n                    path.display(),\n                    meta.source,\n                    meta.level","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/config.rs#L1-L33","documentation":"Guard in `config::list_files`, which lists every config file that contributed sections to the resolved configuration in precedence order. Only the human format is implemented; any other OutputFormat passed from the CLI bails here before the repository is reopened with CLI overrides. It is a feature-gap guard (no machine-readable serializer for the config file listing), triggered solely by the user's `--format` choice, not by repository state.","triggerScenarios":"Calling `list_files` with `OutputFormat::Json` (e.g. `gix config list-files --format json`).","commonSituations":"Tooling that wants machine-readable lists of active config files; uniform `--format json` flags across a pipeline.","solutions":["Use `OutputFormat::Human`","Enumerate `config_snapshot().sections()` and their `meta().path` yourself for structured output","Ask/track for JSON support upstream"],"exampleFix":"// before\nlist_files(repo, overrides, OutputFormat::Json, &mut out)?;\n// after\nlist_files(repo, overrides, OutputFormat::Human, &mut out)?;","handlingStrategy":"validation","validationCode":"if format != gix::output_format::OutputFormat::Human {\n    anyhow::bail!(\"config list-files supports only human output\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use Human format for config file listing","Derive structured data from config_snapshot APIs directly"],"tags":["cli","config","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-15T23:17:13.987Z"}