def repo_iterate(repo, high, low=None):
    """
    Return (yield) one commit by one, from 'high' to 'low'
    (or oldest reachable commit) and in reverse chronological order
    (see rev-list and git log commands)

    :param repo: an initialized git.Repo object
    :param high: top of the version tree to scan; typically tip of the branch,
                HEAD, but it can be any commit
    :param low: optional; the low end of the revision list. When unspecified,
                function will scan the history until the first reachable commit
    :return: a git.Commit object
    """
    refs = high if low is None else '{}..{}'.format(low, high)
    for commit in repo.iter_commits(refs):
        yield commit
