{"record":{"id":"117ede143596ca7d","repo":"GitoxideLabs/gitoxide","slug":"specify-at-least-one-contact-to-run-through-the-ma","errorCode":null,"errorMessage":"specify at least one contact to run through the mailmap","messagePattern":"specify at least one contact to run through the mailmap","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/repository/mailmap.rs","lineNumber":64,"sourceCode":"\n    #[cfg(feature = \"serde\")]\n    serde_json::to_writer_pretty(out, &mailmap.iter().map(JsonEntry::from).collect::<Vec<_>>())?;\n\n    Ok(())\n}\n\npub fn check(\n    repo: gix::Repository,\n    format: OutputFormat,\n    contacts: Vec<BString>,\n    mut out: impl io::Write,\n    mut err: impl io::Write,\n) -> anyhow::Result<()> {\n    if format != OutputFormat::Human {\n        bail!(\"Only human output is supported right now\");\n    }\n    if contacts.is_empty() {\n        bail!(\"specify at least one contact to run through the mailmap\")\n    }\n\n    let mut mailmap = gix::mailmap::Snapshot::default();\n    if let Err(err) = repo.open_mailmap_into(&mut mailmap) {\n        bail!(err);\n    }\n\n    let mut buf = Vec::new();\n    for contact in contacts {\n        let actor = match gix::actor::IdentityRef::from_bytes(&contact) {\n            Ok(a) => a,\n            Err(_) => {\n                let Some(email) = contact\n                    .trim_start()\n                    .strip_prefix(b\"<\")\n                    .and_then(|rest| rest.trim_end().strip_suffix(b\">\"))\n                else {\n                    writeln!(err, \"Failed to parse contact '{contact}' - skipping\")?;","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/mailmap.rs#L46-L82","documentation":"`gix mailmap check` requires at least one contact to run through the mailmap. When the `contacts` list is empty the command bails with this instruction instead of producing empty output. It is an argument-validation guard.","triggerScenarios":"Invoking `gix mailmap check` with no contact arguments, so the `contacts: Vec<BString>` is empty and the `contacts.is_empty()` check fires.","commonSituations":"Running the subcommand with only flags and no positional contact; a script that builds the contact list from a filter that matched nothing; forgetting that contacts are required arguments, not read from stdin.","solutions":["Pass at least one contact, e.g. `gix mailmap check \"Name <email@example.com>\"`","Fix the upstream script/filter that produced an empty contact list","Verify quoting so contacts are not swallowed by the shell"],"exampleFix":"// before\n$ gix mailmap check\n// after\n$ gix mailmap check \"Jane Doe <jane@example.com>\"","handlingStrategy":"validation","validationCode":"if contacts.is_empty() {\n    eprintln!(\"mailmap check needs at least one contact\");\n    std::process::exit(2);\n}\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Require at least one positional contact in wrappers/scripts","Handle the case where a filter yields zero contacts before calling the CLI"],"tags":["cli","validation","arguments"],"backgroundTag":"missing-required-argument","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"}