|
6 | 6 | # that just contains the computed version number.
|
7 | 7 |
|
8 | 8 | # This file is released into the public domain. Generated by
|
9 |
| -# versioneer-0.22 (https://github.com/python-versioneer/python-versioneer) |
| 9 | +# versioneer-0.23 (https://github.com/python-versioneer/python-versioneer) |
10 | 10 |
|
11 | 11 | """Git implementation of _version.py."""
|
12 | 12 |
|
@@ -254,13 +254,12 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command):
|
254 | 254 | print("Directory %s not under git control" % root)
|
255 | 255 | raise NotThisMethod("'git rev-parse --git-dir' returned error")
|
256 | 256 |
|
257 |
| - MATCH_ARGS = ["--match", "%s*" % tag_prefix] if tag_prefix else [] |
258 |
| - |
259 | 257 | # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
|
260 | 258 | # if there isn't one, this yields HEX[-dirty] (no NUM)
|
261 |
| - describe_out, rc = runner(GITS, ["describe", "--tags", "--dirty", |
262 |
| - "--always", "--long", *MATCH_ARGS], |
263 |
| - cwd=root) |
| 259 | + describe_out, rc = runner(GITS, [ |
| 260 | + "describe", "--tags", "--dirty", "--always", "--long", |
| 261 | + "--match", f"{tag_prefix}[[:digit:]]*" |
| 262 | + ], cwd=root) |
264 | 263 | # --long was added in git-1.5.5
|
265 | 264 | if describe_out is None:
|
266 | 265 | raise NotThisMethod("'git describe' failed")
|
@@ -349,8 +348,8 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command):
|
349 | 348 | else:
|
350 | 349 | # HEX: no tags
|
351 | 350 | pieces["closest-tag"] = None
|
352 |
| - count_out, rc = runner(GITS, ["rev-list", "HEAD", "--count"], cwd=root) |
353 |
| - pieces["distance"] = int(count_out) # total number of commits |
| 351 | + out, rc = runner(GITS, ["rev-list", "HEAD", "--left-right"], cwd=root) |
| 352 | + pieces["distance"] = len(out.split()) # total number of commits |
354 | 353 |
|
355 | 354 | # commit date: see ISO-8601 comment in git_versions_from_keywords()
|
356 | 355 | date = runner(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip()
|
@@ -446,7 +445,7 @@ def render_pep440_pre(pieces):
|
446 | 445 | tag_version, post_version = pep440_split_post(pieces["closest-tag"])
|
447 | 446 | rendered = tag_version
|
448 | 447 | if post_version is not None:
|
449 |
| - rendered += ".post%d.dev%d" % (post_version+1, pieces["distance"]) |
| 448 | + rendered += ".post%d.dev%d" % (post_version + 1, pieces["distance"]) |
450 | 449 | else:
|
451 | 450 | rendered += ".post0.dev%d" % (pieces["distance"])
|
452 | 451 | else:
|
|
0 commit comments