{"record":{"id":"5497e385e4949f05","repo":"GitoxideLabs/gitoxide","slug":"json-output-isn-t-yet-supported-for-listing-ref-ma","errorCode":null,"errorMessage":"JSON output isn't yet supported for listing ref-mappings.","messagePattern":"JSON output isn't yet supported for listing ref-mappings\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"info","filePath":"gitoxide-core/src/repository/remote.rs","lineNumber":97,"sourceCode":"        kind: refs::Kind,\n        mut progress: impl gix::Progress,\n        mut out: impl std::io::Write,\n        err: impl std::io::Write,\n        refs::Options {\n            format,\n            name_or_url,\n            handshake_info,\n        }: refs::Options,\n    ) -> anyhow::Result<()> {\n        use anyhow::Context;\n        let mut remote = by_name_or_url(&repo, name_or_url.as_deref())?;\n        let show_unmapped = if let refs::Kind::Tracking {\n            ref_specs,\n            show_unmapped_remote_refs,\n        } = &kind\n        {\n            if format != OutputFormat::Human {\n                bail!(\"JSON output isn't yet supported for listing ref-mappings.\");\n            }\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            *show_unmapped_remote_refs\n        } else {\n            false\n        };\n        progress.info(format!(\n            \"Connecting to {:?}\",\n            remote\n                .url(gix::remote::Direction::Fetch)\n                .context(\"Remote didn't have a URL to connect to\")?\n                .to_bstring()\n        ));\n        let (map, handshake) = remote\n            .connect(gix::remote::Direction::Fetch)","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/remote.rs#L79-L115","documentation":"The `gix refs` tracking-ref-mappings command refuses to run when a non-human (JSON) output format is requested. Listing ref-mappings (local-to-remote ref mapping) simply has no JSON serializer implemented yet in gitoxide-core, so the code bails out early before doing any work. It is an explicit not-yet-implemented guard, not a failure of the operation itself.","triggerScenarios":"Running `gix refs ... --format json` (OutputFormat::Json) for the refs::Kind::Tracking path that lists ref-mappings in `gitoxide-core/src/repository/remote.rs::refs_fn`. The `bail!` fires whenever `format != OutputFormat::Human` and the kind is Tracking.","commonSituations":"Scripting/automation users pass `--format json` for machine-readable output of tracking ref mappings; docs or tab-completion suggest a JSON format that other subcommands support but this one does not yet.","solutions":["Drop `--format json` and use the default human output for this subcommand","Check the gitoxide version/changelog for when JSON output for ref-mappings lands and upgrade","Request or contribute JSON serialization support for ref-mappings in gitoxide-core","Parse the human output yourself as a temporary workaround"],"exampleFix":"// before\ngix refs --tracking --format json\n// after\ngix refs --tracking","handlingStrategy":"validation","validationCode":"// caller-side (shell)\nif [[ \"$requested_format\" != \"human\" ]]; then\n  echo \"refs ref-mapping listing only supports human output\" >&2; exit 2\nfi\ngix refs --tracking --format \"$requested_format\"","typeGuard":null,"tryCatchPattern":"# bash\nif ! out=$(gix refs --tracking --format json 2>&1); then\n  case \"$out\" in *\"isn't yet supported\"*) out=$(gix refs --tracking);; esac\nfi","preventionTips":["Default to human format for gix refs; reserve --format json for subcommands that document it","Check --help of the exact subcommand before scripting against JSON","Wrap gix CLI calls so unsupported-format errors fall back to human output","Pin and review gitoxide release notes for format support changes"],"tags":["cli","json","not-implemented","refs"],"backgroundTag":"unsupported-operation","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}