TAG[-DISTANCE-gHEX][-dirty]. Like 'git describe --tags --dirty --always'. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix)
(pieces)
| 560 | |
| 561 | |
| 562 | def render_git_describe(pieces): |
| 563 | """TAG[-DISTANCE-gHEX][-dirty]. |
| 564 | |
| 565 | Like 'git describe --tags --dirty --always'. |
| 566 | |
| 567 | Exceptions: |
| 568 | 1: no tags. HEX[-dirty] (note: no 'g' prefix) |
| 569 | """ |
| 570 | if pieces["closest-tag"]: |
| 571 | rendered = pieces["closest-tag"] |
| 572 | if pieces["distance"]: |
| 573 | rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) |
| 574 | else: |
| 575 | # exception #1 |
| 576 | rendered = pieces["short"] |
| 577 | if pieces["dirty"]: |
| 578 | rendered += "-dirty" |
| 579 | return rendered |
| 580 | |
| 581 | |
| 582 | def render_git_describe_long(pieces): |
no outgoing calls
no test coverage detected
searching dependent graphs…