GitoxideLabs/gitoxide · info · anyhow::Error
Only human output is supported for now
Error message
Only human output is supported for now
What it means
`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.
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
Example fix
// before gix submodule list --format json // after gix submodule list
Defensive patterns
Strategy: validation
Validate before calling
[ "$fmt" = "human" ] || { echo "submodule list supports only human output" >&2; exit 2; } Try / catch
if ! gix submodule list --format json 2>err.log; then grep -q 'Only human output' err.log && gix submodule list fi
Prevention
- 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
When it happens
Trigger: 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.
Common situations: Automation wanting machine-readable submodule inventories; users expecting feature parity with other JSON-capable gix subcommands; CI tooling parsing submodule state.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- JSON output isn't implemented yet
- JSON output isn't yet supported for listing ref-mappings.
- Only human output is currently supported
- Only human format is supported right now
- JSON output isn't supported
AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08).
Data as JSON: /api/errors/a7ade181bf95c324.
Report an issue: GitHub.
Appendix: source
Thrown at gitoxide-core/src/repository/submodule.rs:13
use anyhow::bail;
use gix::{Repository, Submodule, commit::describe::SelectRef, prelude::ObjectIdExt};
use crate::OutputFormat;
pub fn list(
repo: Repository,
mut out: impl std::io::Write,
format: OutputFormat,
dirty_suffix: Option<String>,
) -> anyhow::Result<()> {
if format != OutputFormat::Human {
bail!("Only human output is supported for now")
}
let Some(submodules) = repo.submodules()? else {
return Ok(());
};
for sm in submodules {
print_sm(sm, dirty_suffix.as_deref(), &mut out)?;
}
Ok(())
}
fn print_sm(sm: Submodule<'_>, dirty_suffix: Option<&str>, out: &mut impl std::io::Write) -> anyhow::Result<()> {
let _span = gix::trace::coarse!("print_sm", path = ?sm.path());
let state = sm.state()?;
let mut sm_repo = sm.open()?;
if let Some(repo) = sm_repo.as_mut() {
repo.object_cache_size_if_unset(4 * 1024 * 1024);
}View on GitHub (pinned to e73179060b)