pub struct IdentFields<'a> {
pub name: &'a [u8],
pub email: &'a [u8],
pub date: Option<&'a [u8]>,
pub tz: Option<&'a [u8]>,
}Expand description
A tolerant parse-view of a git identity line split git’s way (ident.c’s
split_ident_line). Unlike Signature::from_ident_line — which is a
strict, byte-exact round-trip parser — this mirrors how git’s pretty-printer
recovers fields from broken idents: the email is the run between the
first < and the first following >, while the timestamp is located
by scanning backwards from the end of the line for the last >. That
split lets a corrupt ident like Name <a@b>-<> 123 +0000 still surrender the
correct name (Name), email (a@b), and date (123 +0000).
Fields§
§name: &'a [u8]Everything before the first <, with one trailing separator space removed.
email: &'a [u8]The bytes between the first < and the first following >.
date: Option<&'a [u8]>The decimal timestamp digit-run, or None when the line has no parseable
<digits> <±digits> date tail (git’s “person only” case).
tz: Option<&'a [u8]>The timezone token (± plus digits), present iff date is.