def METHOD_NAME(commit: Any) -> CommitInfo:
    match = re.match(r"(.*) \(#(\d+)\)", commit.summary)
    if match:
        return CommitInfo(hexsha=commit.hexsha, title=str(match.group(1)), pr_number=int(match.group(2)))
    else:
        return CommitInfo(hexsha=commit.hexsha, title=commit.summary, pr_number=None)