

def render_git_describe(pieces):
    if pieces['closest-tag']:
        rendered = pieces['closest-tag']
        if pieces['distance']:
            rendered += ('-%d-g%s' % (pieces['distance'], pieces['short']))
    else:
        rendered = pieces['short']
    if pieces['dirty']:
        rendered += '-dirty'
    return rendered

dataset/ETHPy150Open Anaconda-Platform/chalmers/versioneer.py render_git_describe/original