{"record":{"id":"a7ade181bf95c324","repo":"GitoxideLabs/gitoxide","slug":"only-human-output-is-supported-for-now","errorCode":null,"errorMessage":"Only human output is supported for now","messagePattern":"Only human output is supported for now","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"info","filePath":"gitoxide-core/src/repository/submodule.rs","lineNumber":13,"sourceCode":"use anyhow::bail;\nuse gix::{Repository, Submodule, commit::describe::SelectRef, prelude::ObjectIdExt};\n\nuse crate::OutputFormat;\n\npub fn list(\n    repo: Repository,\n    mut out: impl std::io::Write,\n    format: OutputFormat,\n    dirty_suffix: Option<String>,\n) -> anyhow::Result<()> {\n    if format != OutputFormat::Human {\n        bail!(\"Only human output is supported for now\")\n    }\n\n    let Some(submodules) = repo.submodules()? else {\n        return Ok(());\n    };\n    for sm in submodules {\n        print_sm(sm, dirty_suffix.as_deref(), &mut out)?;\n    }\n    Ok(())\n}\n\nfn print_sm(sm: Submodule<'_>, dirty_suffix: Option<&str>, out: &mut impl std::io::Write) -> anyhow::Result<()> {\n    let _span = gix::trace::coarse!(\"print_sm\", path = ?sm.path());\n    let state = sm.state()?;\n    let mut sm_repo = sm.open()?;\n    if let Some(repo) = sm_repo.as_mut() {\n        repo.object_cache_size_if_unset(4 * 1024 * 1024);\n    }","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/submodule.rs#L1-L31","documentation":"`gix submodule list` only supports human-readable output; a non-Human OutputFormat (e.g. JSON) makes `list` bail before enumerating submodules. JSON serialization for submodule listings is not yet implemented in gitoxide-core.","triggerScenarios":"Calling `gix submodule list --format json` — the check at the top of `list` in gitoxide-core/src/repository/submodule.rs rejects any format besides OutputFormat::Human.","commonSituations":"Automation wanting machine-readable submodule inventories; users expecting feature parity with other JSON-capable gix subcommands; CI tooling parsing submodule state.","solutions":["Use the default human output for `gix submodule list`","Use `git submodule status --recursive` for a script-parseable listing today","Read submodules programmatically via the `gix` library (`repo.submodules()`)","Watch for JSON support being added in future gitoxide releases"],"exampleFix":"// before\ngix submodule list --format json\n// after\ngix submodule list","handlingStrategy":"validation","validationCode":"[ \"$fmt\" = \"human\" ] || { echo \"submodule list supports only human output\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":"if ! gix submodule list --format json 2>err.log; then\n  grep -q 'Only human output' err.log && gix submodule list\nfi","preventionTips":["Don't request --format json for submodule listing until supported","Use `git submodule status` for machine parsing today","Prefer the gix library (repo.submodules()) for programmatic access","Keep CLI format flags validated centrally in wrapper scripts"],"tags":["cli","json","not-implemented","submodule"],"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"}