Skip to content

Fix time-stamping to work with GPG signed commits#64

Open
shinnok wants to merge 1 commit into
masterfrom
fix-timestamp
Open

Fix time-stamping to work with GPG signed commits#64
shinnok wants to merge 1 commit into
masterfrom
fix-timestamp

Conversation

@shinnok
Copy link
Copy Markdown

@shinnok shinnok commented Aug 7, 2023

If HEAD is pointing to a gpg-signed commit, the result of the previous GET_CURRENT_COMMIT_TIMESTAMP expression will include GPG info, which in turn will end up in .update.timestamp for the current project. This is especially relevant if the user has configured git config log.showSignature true.

Fix this behavior by ignoring irrelevant GPG signed status with --no-show-signature.

If HEAD is pointing to a signed commit, the result of the expression
GET_CURRENT_COMMIT_TIMESTAMP will include GPG info, which in turn will
end up in .update.timestamp for the current project.
@arnetheduck
Copy link
Copy Markdown
Member

this would bump git version req to ... 2.10 I think - is there another way to avoid it (ie sed?)

@shinnok
Copy link
Copy Markdown
Author

shinnok commented Aug 8, 2023

Given my specific output scenario:

$ git log --pretty=format:%cd -n 1 --date=unix
gpg: Signature made Tue Aug  8 10:16:42 2023 EEST
gpg:                using RSA key DC57D8288951F46
gpg: Good signature from "Teodor <redacted>" [ultimate]
1691479002

Assuming that GPG output will always start with gpg: for everyone, we can gpg -v or sed it out. However, I would actually tail -n1 to get the timestamp out, do you think this is a better assumption? That the timestamp has a better chance to end up on the last line, than otherwise.

@shinnok
Copy link
Copy Markdown
Author

shinnok commented Aug 21, 2023

@arnetheduck Hi, what do you think of just grabbing the last line with tail, should I just push a change with just that, for the time being?

@arnetheduck
Copy link
Copy Markdown
Member

Hi, what do you think of just grabbing the last line with tail, should I just push a change with just that, for the time being?

I think that it's an excellent idea provided you test it with some git versions that ship with non-obsolete LTS releases of debian / ubuntu / redhat.

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