{"record":{"id":"5c40a48f72592903","repo":"GitoxideLabs/gitoxide","slug":"json-output-isn-t-yet-supported-for-fetching-5c40a4","errorCode":null,"errorMessage":"JSON output isn't yet supported for fetching.","messagePattern":"JSON output isn't yet supported for fetching\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/repository/fetch.rs","lineNumber":56,"sourceCode":"        mut out: impl std::io::Write,\n        err: impl std::io::Write,\n        Options {\n            format,\n            dry_run,\n            remote,\n            handshake_info,\n            negotiation_info,\n            open_negotiation_graph,\n            shallow,\n            ref_specs,\n        }: Options,\n    ) -> anyhow::Result<()>\n    where\n        P: gix::NestedProgress,\n        P::SubProgress: 'static,\n    {\n        if format != OutputFormat::Human {\n            bail!(\"JSON output isn't yet supported for fetching.\");\n        }\n\n        let mut remote = crate::repository::remote::by_name_or_url(&repo, remote.as_deref())?;\n        if !ref_specs.is_empty() {\n            remote.replace_refspecs(ref_specs.iter(), gix::remote::Direction::Fetch)?;\n            remote = remote.with_fetch_tags(gix::remote::fetch::Tags::None);\n        }\n        let res: gix::remote::fetch::Outcome = remote\n            .connect(gix::remote::Direction::Fetch)?\n            .prepare_fetch(&mut progress, Default::default())?\n            .with_dry_run(dry_run)\n            .with_shallow(shallow)\n            .receive(&mut progress, &gix::interrupt::IS_INTERRUPTED)?;\n\n        if handshake_info {\n            writeln!(out, \"Handshake Information\")?;\n            writeln!(out, \"\\t{:?}\", res.handshake)?;\n        }","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/fetch.rs#L38-L74","documentation":"The `fetch` command reports fetch progress/results in human-readable form only; JSON output for fetching has not been implemented. Passing any non-Human OutputFormat throws this error before any network work starts.","triggerScenarios":"Calling `fetch` in gitoxide-core/src/repository/fetch.rs with `format != OutputFormat::Human`, e.g. `gix fetch --format json origin`.","commonSituations":"Automation wrapping fetch output in JSON; users copying the format flag from subcommands that support JSON.","solutions":["Use the default human format (omit `--format` or pass `human`)","Parse human output for automation (fragile)","Implement or request JSON support for fetch"],"exampleFix":"// before\nfetch(repo, remote, ref_specs, dry_run, OutputFormat::Json, progress)?;\n// after\nfetch(repo, remote, ref_specs, dry_run, OutputFormat::Human, progress)?;","handlingStrategy":"validation","validationCode":"if format != OutputFormat::Human {\n    eprintln!(\"fetch only supports human output\");\n    format = OutputFormat::Human;\n}","typeGuard":null,"tryCatchPattern":"match fetch(repo, remote, ref_specs, dry_run, format, progress) {\n    Err(e) if e.to_string().contains(\"JSON output\") => {\n        fetch(repo, remote, ref_specs, dry_run, OutputFormat::Human, progress)?\n    }\n    other => other?,\n}","preventionTips":["Do not request JSON from fetch until implemented","Parse fetch progress via progress callbacks instead of output format","Check --help for supported formats per subcommand"],"tags":["cli","fetch","not-implemented"],"backgroundTag":"method-not-implemented","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"}