(pieces)
return rendered
TAG[-DISTANCE-gHEX][-dirty].

    Like 'git describe --tags --dirty --always'.

    Exceptions:
    1: no tags. HEX[-dirty]  (note: no 'g' prefix)
TAG[-DISTANCE-gHEX][-dirty].
TAG [ - DISTANCE - gHEX ] [ - dirty ] .
def render_git_describe(pieces):
    """TAG[-DISTANCE-gHEX][-dirty].

    Like 'git describe --tags --dirty --always'.

    Exceptions:
    1: no tags. HEX[-dirty]  (note: no 'g' prefix)
    """
    if pieces["closest-tag"]:
        rendered = pieces["closest-tag"]
        if pieces["distance"]:
            rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
    else:
        # exception #1
        rendered = pieces["short"]
    if pieces["dirty"]:
        rendered += "-dirty"
    return rendered
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 : # exception #1 rendered = pieces [ "short" ] if pieces [ "dirty" ] : rendered += "-dirty" return rendered