def stat_range(repo, base, new):
    """Return a diff stat from the history on 'new' that is not on 'base'.

    Note that commits that are cherry-picked from new to old will still appear
    in the diff, this function operates using the commit graph only.

    Raise if git returns a non-zero exit code.

    :repo: a callable supporting git commands, e.g. repo("status")
    :base: the string name of the base branch
    :new: the string name of the branch with new commits
    :returns: a string of the diff stat

    """
    return repo(
        "diff",
        "--stat",
        base + "..." + new,
        "-M")