def amended_commits(commits):
    """Return those git commit sha1s that have been amended later."""
    # which SHA1 are declared as amended later?
    amended_sha1s = []
    for message in commits.values():
        amended_sha1s.extend(re.findall(r'AMENDS\s([0-f]+)', message))
    return amended_sha1s
Return those git commit sha1s that have been amended later.