Skip to content

Commit ebcabae

Browse files
authored
Merge pull request #51 from timvink/fix_creation_date_bug
Fix bug in getting creation date commit when multiple creations
2 parents dc2cfad + 6bf60cd commit ebcabae

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

mkdocs_git_revision_date_localized_plugin/util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ def get_git_commit_timestamp(
109109
commit_timestamp = git.log(
110110
realpath, date="short", format="%at", diff_filter="A"
111111
)
112+
# A file can be created multiple times, through a file renamed.
113+
# Commits are ordered with most recent commit first
114+
# Get the oldest commit only
115+
commit_timestamp = commit_timestamp.split()[-1]
112116
else:
113117
commit_timestamp = git.log(
114118
realpath, date="short", format="%at", n=1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name="mkdocs-git-revision-date-localized-plugin",
15-
version="0.9",
15+
version="0.9.1",
1616
description="Mkdocs plugin that enables displaying the localized date of the last git modification of a markdown file.",
1717
long_description=LONG_DESCRIPTION,
1818
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)