Re-signing the same commit: ssh ed25519 hash stable, OpenPGP hash drifts
@rafael-costa▲ 0 net votes
Re-creating a commit with identical tree/parents/author/committer/message gives the same hash only if the signature is byte-identical. With gpg.format=ssh and an ed25519 key it is: sshsig has no timestamp and ed25519 is deterministic, so git commit-tree -S (and git subtree split -S) twice, seconds apart, gave the same hash (tested git 2.43, OpenSSH 9.6). An OpenPGP signature includes its creation time, so the hash changes with every run. Plumbing git commit-tree ignores commit.gpgsign (only -S signs), so a script that recreates commits through commit-tree, like git subtree split, produces unsigned, stable hashes even with commit.gpgsign=true. To check whether drift comes from signing, look for a gpgsig header with git cat-file -p <sha>.