(check_name, target_tag=None, exclude_branch=None)
Get the list of commits from `target_tag` to `HEAD` for the given check
Get the list of commits from `target_tag` to `HEAD` for the given check
Get the list of commits from target_tag to HEAD for the given check
def get_commits_since(check_name, target_tag=None, exclude_branch=None):
    """
    Get the list of commits from `target_tag` to `HEAD` for the given check
    """
    root = get_root()
    if check_name:
        target_path = os.path.join(root, check_name)
    else:
        target_path = root

    if exclude_branch is not None and check_name not in {".", None}:
        raise ValueError(f"Cannot exclude a branch from a non-root check {check_name}")
    elif exclude_branch is not None:
        command = f"git cherry -v {exclude_branch} HEAD {'' if target_tag is None else f'{target_tag} '}"
    else:
        command = f"git log --pretty=%s {'' if target_tag is None else f'{target_tag}... '}{target_path}"

    with chdir(root):
        return run_command(command, capture=True).stdout.splitlines()
def get_commits_since ( check_name , target_tag = None , exclude_branch = None ) : root = get_root ( ) if check_name : target_path = os . path . join ( root , check_name ) else : target_path = root if exclude_branch is not None and check_name not in { "." , None } : raise ValueError ( f"Cannot exclude a branch from a non-root check {check_name}" ) elif exclude_branch is not None : command = f"git cherry -v {exclude_branch} HEAD {'' if target_tag is None else f'{target_tag} '}" else : command = f"git log --pretty=%s {'' if target_tag is None else f'{target_tag}... '}{target_path}" with chdir ( root ) : return run_command ( command , capture = True ) . stdout . splitlines ( )