GitoxideLabs/gitoxide · error

JSON output isn't yet supported for fetching.

Error message

JSON output isn't yet supported for fetching.

What it means

`clone` (fetch) only supports human-readable progress output; a non-Human `OutputFormat` is rejected up front with `bail!` before any network work starts. JSON streaming of fetch progress is not implemented.

Solutions

  1. Use `OutputFormat::Human` for cloning
  2. Drive `gix::clone` / fetch programmatically in your own code and consume the progress events directly for structured output
  3. Track upstream gitoxide for JSON clone support

Example fix

// before
clone(url, directory, repo, OutputFormat::Json, progress, &mut out)?;
// after
clone(url, directory, repo, OutputFormat::Human, progress, &mut out)?;
Defensive patterns

Strategy: validation

Validate before calling

assert_eq!(format, gix::output_format::OutputFormat::Human, "clone supports only human output");

Prevention

When it happens

Trigger: Calling `gitoxide_core::repository::clone::clone` with `OutputFormat::Json` (e.g. `gix clone --format json <url>`).

Common situations: Tooling that standardizes on JSON output for all subcommands; parsing clone progress programmatically; CI dashboards expecting structured events.

Related errors


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

Appendix: source

Thrown at gitoxide-core/src/repository/clone.rs:46

        mut progress: P,
        mut out: impl std::io::Write,
        mut err: impl std::io::Write,
        Options {
            format,
            handshake_info,
            bare,
            no_tags,
            ref_name,
            revision,
            shallow,
        }: Options,
    ) -> anyhow::Result<()>
    where
        P: NestedProgress,
        P::SubProgress: 'static,
    {
        if format != OutputFormat::Human {
            bail!("JSON output isn't yet supported for fetching.");
        }

        let url: gix::Url = url.as_ref().try_into()?;
        let directory = directory.map_or_else(
            || {
                let path = gix::path::from_bstr(Cow::Borrowed(url.path.as_ref()));
                if !bare && path.extension() == Some(OsStr::new("git")) {
                    path.file_stem().map(Into::into)
                } else {
                    path.file_name().map(Into::into)
                }
                .context("Filename extraction failed - path too short")
            },
            |dir| Ok(dir.into()),
        )?;
        let mut prepare = gix::clone::PrepareFetch::new(
            url,
            directory,

View on GitHub (pinned to e73179060b)