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

Enforce '--no-show-signature' on git-log timestamp retrieval #51

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

riton
Copy link
Contributor

@riton riton commented Oct 14, 2022

Context

I've experienced a problem building the copier project from source using the poetry build command.

copier uses poetry-dynamic-versioning.

The poetry build command fails with the following error:

copier on  HEAD (9735f73) [!] 
❯ poetry build

time data "gpg: Signature made Wed Oct 12 14:41:26 2022 CEST\ngpg:                using EDDSA key 83C8FC19286635F94800F1CBE47E3BE44B940490\ngpg: Can't check signature: No public key\n2022-10-12T14:41:21+0200" does not match format '%Y-%m-%dT%H:%M:%S%z'

The git command that is at the origin of the problem is:

copier on  HEAD (9735f73) [!] 
❯ git log -n 1 --pretty=format:"%cI"
gpg: Signature made Wed Oct 12 14:41:26 2022 CEST
gpg:                using EDDSA key 83C8FC19286635F94800F1CBE47E3BE44B940490
gpg: Can't check signature: No public key
2022-10-12T14:41:21+02:00

The gpg signature headers get in the way of the timestamp retrieval logic.

My git configuration

This signature is displayed because I do have

[log]
  showSignature = true

in my ~/.gitconfig file.

Can I reproduce with other projects ?

I was able to reproduce the problem with other projects relying on poetry-dynamic-versioning.

Proposed solution

I know that the root cause of the problem is the showSignature = true setting in my ~/.gitconfig file.

But if we enforce the --no-show-signature git-log flag, we ensures that no Signature message could get in the way of the git-log timestamp parsing logic.

copier on  HEAD (9735f73) [!] 
❯ git log --no-show-signature -n 1 --pretty=format:"%cI"
2022-10-12T14:41:21+02:00

* The '--no-show-signature' flag ensures that no 'Signature' message
  could get in the way of the 'git-log timestamp' parsing logic
Copy link
Owner

@mtkennerly mtkennerly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix and detailed explanation! I'll release this shortly.

@mtkennerly mtkennerly added this to the v0.13.2 milestone Oct 14, 2022
@mtkennerly mtkennerly merged commit 25ccf03 into mtkennerly:master Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants