import re


def log_lines_match(a_line: str, b_line: str) -> bool:
    """Compares two lines from two git log files to see if they match.

    Ignores varying content in the 3 commit header lines.
    Arguments:
        a_line {str} -- line from a git log
        b_line {str} -- line from another git log

    Returns:
        bool -- True if the lines match.
    """
    # Skip the commit header lines because they vary.
    if a_line == b_line:
        return True
    commit_header = [
        re.compile(r"\s*commit [a-f0-9]+\s*"),
        re.compile(r"\s*Author:.*", re.DOTALL),
        re.compile(r"\s*Date:.*", re.DOTALL),
        re.compile(r"\s*index [0-9a-f]+..[0-9a-f]+ [0-9]+\s*"),
    ]
    for commit_header_line in commit_header:
        if commit_header_line.fullmatch(a_line) and commit_header_line.fullmatch(
            b_line
        ):
            return True
    return False