Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date detection from "git log" is broken when git client is configured with "--show-signature" #124

Open
yuha0 opened this issue Jun 24, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@yuha0
Copy link

yuha0 commented Jun 24, 2022

I can't build mkdocs sites from repositories where commits are signed and git client is configured to always show commit signature.

The problem seems to be here:

if not dt_created:
dt_created = self.repo.log(
in_page.file.abs_src_path,
n=1,
date="short",
format="%at",
diff_filter="AR",
)
if not dt_updated:
dt_updated = self.repo.log(
in_page.file.abs_src_path,
n=1,
date="short",
format="%at",
)

It assumes that git log -1 --date=short --format="%at"'s output will only contain the timestamp and nothing else, which isn't true.

My gitconfig contains:

[log]
    showSignature = true

Which is equivalent to git log --show-signature ..., and the output will always contain commit signature info:

$ git log --date=short -1 --format="%at"
gpg: Signature made Tue Jun 21 17:19:48 2022 PDT
gpg:                using EDDSA key 90DA57F75A16D8729DBEE227CD67D78AC53D68C5
gpg: Good signature from "Yuhao Zhang <[email protected]>" [ultimate]
1655857188

And the plugin will crash at:

int(dt_created),
int(dt_updated),

Because the whole string cannot be converted to int.

@Guts
Copy link
Owner

Guts commented Jun 30, 2022

Really interesting use case!

Thanks for the PR! I'm gonna to review it right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants