def get_git_derived_build_number(repo, commit_path):
    """
        Get a build number counting from the last commit of a specified file.
        If that file is the version stamp then this counts the number of commits
        the last version change - a good enough approximation to a CI independent
        build number.
    """
    that_commit = list(repo.iter_commits(None, paths=commit_path, max_count=1))[0].hexsha
    this_commit = list(repo.iter_commits())[0].hexsha
    # print('Derive number for commit (of _version.txt): ', that_commit)
    return len(list(repo.iter_commits(rev='{}^..{}'.format(that_commit, this_commit))))