GitoxideLabs/gitoxide · error

Only human output format is supported at the moment

Error message

Only human output format is supported at the moment

What it means

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.

Solutions

  1. Use `OutputFormat::Human`
  2. Enumerate `config_snapshot().sections()` and their `meta().path` yourself for structured output
  3. Ask/track for JSON support upstream

Example fix

// before
list_files(repo, overrides, OutputFormat::Json, &mut out)?;
// after
list_files(repo, overrides, OutputFormat::Human, &mut out)?;
Defensive patterns

Strategy: validation

Validate before calling

if format != gix::output_format::OutputFormat::Human {
    anyhow::bail!("config list-files supports only human output");
}

Prevention

When it happens

Trigger: Calling `list_files` with `OutputFormat::Json` (e.g. `gix config list-files --format json`).

Common situations: Tooling that wants machine-readable lists of active config files; uniform `--format json` flags across a pipeline.

Related errors


AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08). Data as JSON: /api/errors/13bd4421b3d4d4e0. Report an issue: GitHub.

Appendix: source

Thrown at gitoxide-core/src/repository/config.rs:15

use anyhow::{Context, Result, bail};
use gix::{bstr::BString, config::AsKey};
use std::io::Write as _;

use crate::OutputFormat;

/// List all files which contributed sections to the resolved configuration, in precedence order.
pub fn list_files(
    repo: gix::Repository,
    overrides: Vec<BString>,
    format: OutputFormat,
    mut out: impl std::io::Write,
) -> Result<()> {
    if format != OutputFormat::Human {
        bail!("Only human output format is supported at the moment");
    }
    let repo = gix::open_opts(repo.git_dir(), repo.open_options().clone().cli_overrides(overrides))?;
    let config = repo.config_snapshot();
    let mut seen = std::collections::BTreeSet::new();
    for meta in config.sections().map(|section| section.meta()).chain([config.meta()]) {
        let Some(path) = meta.path.as_ref() else {
            continue;
        };
        if seen.insert(path) {
            if meta.level == 0 {
                writeln!(out, "{}\t{{ source={:?} }}", path.display(), meta.source)?;
            } else {
                writeln!(
                    out,
                    "{}\t{{ source={:?}, include-level={} }}",
                    path.display(),
                    meta.source,
                    meta.level

View on GitHub (pinned to e73179060b)