mkdocs-rss-plugin
mkdocs-rss-plugin copied to clipboard
date detection from "git log" is broken when git client is configured with "--show-signature"
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:
https://github.com/Guts/mkdocs-rss-plugin/blob/c9b1c8b17794ea5ff2fb1fa4ccecbf74bc220ca7/mkdocs_rss_plugin/util.py#L145-L159
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:
https://github.com/Guts/mkdocs-rss-plugin/blob/c9b1c8b17794ea5ff2fb1fa4ccecbf74bc220ca7/mkdocs_rss_plugin/util.py#L179-L180
Because the whole string cannot be converted to int
.
Really interesting use case!
Thanks for the PR! I'm gonna to review it right now.