Skip to content

Commit 2a52f64

Browse files
authored
Merge pull request #112 from jwodder/gh-111
Don't crash when `log.showSignature` is set in `.gitconfig`
2 parents d38ab9b + 38d7482 commit 2a52f64

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
v3.2.0 (in development)
1+
v3.1.3 (in development)
22
-----------------------
33
- Support Python 3.13
4+
- **Bugfix**: Don't crash when `log.showSignature` is set in `.gitconfig`
45

56
v3.1.2 (2024-07-20)
67
-------------------

src/versioningit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<https://versioningit.rtfd.io> for more information.
4444
"""
4545

46-
__version__ = "3.2.0.dev1"
46+
__version__ = "3.1.3.dev1"
4747
__author__ = "John Thorvald Wodder II"
4848
__author_email__ = "[email protected]"
4949
__license__ = "MIT"

src/versioningit/git.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ def describe_git(*, project_dir: str | Path, params: dict[str, Any]) -> VCSDescr
236236
if "revision" not in vdesc.fields:
237237
revision, author_ts, committer_ts = repo.read(
238238
"--no-pager", "show", "-s", "--format=%H%n%at%n%ct"
239-
).splitlines()
239+
).splitlines()[-3:]
240+
# [-3:] to discard possible leading GPG signature
241+
# <https://github.com/jwodder/versioningit/issues/111>
240242
vdesc.fields["revision"] = revision
241243
vdesc.fields["author_date"] = fromtimestamp(int(author_ts))
242244
vdesc.fields["committer_date"] = fromtimestamp(int(committer_ts))

0 commit comments

Comments
 (0)