For example:
>>> email.utils.parseaddr('alice@example.net')
('', 'alice@example.net')
Now folks with:
From: alice@example.net
will be stored in the Git commit as:
"alice@example.net" <alice@example.net>
"""Create a pygit2.Signature for the message author."""
author_name, author_email = _email_utils.parseaddr(
message['From'])
+ if not author_name:
+ author_name = author_email.split('@')[0]
date = message['Date']
datetime = _email_utils.parsedate_to_datetime(date)
time = int(datetime.timestamp())