GitoxideLabs/gitoxide · error

JSON output isn't implemented yet

Error message

JSON output isn't implemented yet

What it means

Guard clause at the top of `attributes::validate_baseline`, the plumbing command that validates gitattributes against a baseline. Like most gitoxide-core plumbing commands, only human-readable output is implemented; if the caller selects any other OutputFormat (e.g. JSON) the function bails immediately before doing any work. It fires purely from user format selection and indicates a missing feature, not a data problem — no JSON serializer exists for attribute validation results.

Solutions

  1. Run with human output and parse the text report
  2. Capture the mismatch listing written to stderr and format it yourself
  3. File/track an upstream feature request for JSON baseline validation output

Example fix

// before
validate_baseline(repo, repo_path, out, err, Options { format: OutputFormat::Json, .. })?;
// after
validate_baseline(repo, repo_path, out, err, Options { format: OutputFormat::Human, .. })?;
Defensive patterns

Strategy: validation

Validate before calling

if format != OutputFormat::Human {
    eprintln!("validate-baseline: JSON not implemented; using Human");
    format = OutputFormat::Human;
}

Try / catch

match validate_baseline(repo, repo_path, out, err, opts) {
    Err(e) if e.to_string().contains("JSON output isn't implemented") => {
        // rerun with Human format
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling `repository::attributes::validate_baseline` with `format == OutputFormat::Json` (or any non-Human variant) via the corresponding CLI flag.

Common situations: CI pipelines requesting JSON reports from baseline validation; tooling that assumes all subcommands emit JSON.

Related errors


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

Appendix: source

Thrown at gitoxide-core/src/repository/attributes/validate_baseline.rs:45

    use crate::{
        OutputFormat,
        repository::attributes::{query::attributes_cache, validate_baseline::Options},
    };

    pub fn validate_baseline(
        repo: gix::Repository,
        paths: Option<impl Iterator<Item = BString> + Send + 'static>,
        mut progress: impl gix::NestedProgress + 'static,
        mut out: impl io::Write,
        mut err: impl io::Write,
        Options {
            format,
            statistics,
            mut ignore,
        }: Options,
    ) -> anyhow::Result<()> {
        if format != OutputFormat::Human {
            bail!("JSON output isn't implemented yet");
        }

        if repo.is_bare() {
            writeln!(
                err,
                "Repo at '{repo}' is bare - disabling git-ignore baseline as `git check-ignore` needs a worktree",
                repo = repo.path().display()
            )
            .ok();
            ignore = false;
        }
        let mut num_entries = None;
        let paths = paths.map_or_else(
            {
                let repo = repo.clone();
                let num_entries = &mut num_entries;
                move || -> anyhow::Result<_> {
                    let index = repo.index_or_load_from_head()?.into_owned();

View on GitHub (pinned to e73179060b)