def diff_branch(target_branch):
    with hide('running', 'stdout'):
        puts('fetching upstream branches...')
        local('git fetch')
        rev_list = 'git rev-list --count --left-right {}...HEAD'.format(
            target_branch)
        upstream_counts = local(rev_list, capture=True)

    upstream_ahead, local_ahead = map(int, upstream_counts.split('\t'))
    return upstream_ahead, local_ahead
Compares your current git HEAD to `target_branch` and returns a tuple
dataset/ETHPy150Open onefinestay/gonzo/gonzo/helpers/git.py/diff_branch