GitoxideLabs/gitoxide · warning

BUG: ResolvedSignatures don't exist here when nothing is set

Error message

BUG: ResolvedSignatures don't exist here when nothing is set

What it means

`gix_mailmap`'s `enriched_signature()` computes a new signature from optional replacement name/email pairs. The library panics because the function is only ever invoked after `try_resolve`/`resolve_cow` matched at least one mailmap entry, so at least one of name/email must be `Some`; a `(None, None)` result would mean the internal `ResolvedSignatures` state was constructed incorrectly.

Solutions

  1. Construct resolution state via the public `Snapshot`/`Signatures` APIs rather than building `ResolvedSignatures` manually.
  2. Ensure mailmap entries parsed from `.mailmap` are non-empty; empty entries should be skipped at parse time.
  3. Report upstream with a reproducing `.mailmap` and input signature if this is ever hit through normal `Snapshot::resolve` usage.
Defensive patterns

Strategy: validation

Validate before calling

// Ensure mailmap resolution state always carries at least one replacement
if name_replacement.is_none() && email_replacement.is_none() {
    return Err(anyhow::anyhow!("mailmap resolution produced empty replacement"));
}

Type guard

fn has_any_replacement(sig: &ResolvedSignatures) -> bool {
    sig.new_name.is_some() || sig.new_email.is_some()
}

Prevention

When it happens

Trigger: Not reachable from public APIs: it fires only if the mailmap matching layer produces a resolution record where both the replacement name and replacement email are `None`, which its constructors forbid.

Common situations: Seen only during gix-mailmap internal development or when deserializing/constructing `ResolvedSignatures` by hand with empty fields instead of using the proper constructor.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08). Data as JSON: /api/errors/34d9885e311f8513. Report an issue: GitHub.

Appendix: source

Thrown at gix-mailmap/src/snapshot/mod.rs:176

    new: ResolvedSignature<'_>,
) -> Signature<'a> {
    match (new.email, new.name) {
        (Some(new_email), Some(new_name)) => Signature {
            email: new_email.to_owned().into(),
            name: new_name.to_owned().into(),
            time: time.parse().unwrap_or_default(),
        },
        (Some(new_email), None) => Signature {
            email: new_email.to_owned().into(),
            name: name.into(),
            time: time.parse().unwrap_or_default(),
        },
        (None, Some(new_name)) => Signature {
            email: email.into(),
            name: new_name.to_owned().into(),
            time: time.parse().unwrap_or_default(),
        },
        (None, None) => unreachable!("BUG: ResolvedSignatures don't exist here when nothing is set"),
    }
}

View on GitHub (pinned to e73179060b)