def get_commits(base_commit, head_commit):
    """Gets list of commit hashes between base commit and head commit.

    Args:
        base_commit: String containing hash of the most recently used commit in
            a review.
        head_commit: String containing hash of the HEAD commit in the current
            review.

    Returns:
        List of commit hashes as strings.
    """
    rev_list_arg = '%s..%s' % (base_commit, head_commit)
    rev_list_output = capture_command(
            'git', 'rev-list', rev_list_arg, single_line=False)
    commits = rev_list_output.split('\n') if rev_list_output else []
    [_check_hash(commit_hash) for commit_hash in commits]
    return commits
dataset/ETHPy150Open googlearchive/git-rv/utils.py/get_commits/original