From 09e7650d7f753e07744ba2c72b3b44020c5e5376 Mon Sep 17 00:00:00 2001 From: Jonas Fierlings Date: Sat, 6 Jul 2024 13:39:48 +0200 Subject: [PATCH] feat: Skip ssh and x509 signatures in tag messages Git supports SSH and x509 signatures in addition to GPG signatures. See . The regex is not 100% accurate (e.g. this would allow `SSH MESSAGE`, which is not part of the gitformat-signature description), but I prioritized readability over correctness in this case (since the code is for replacing text, not verifying the signature). --- git-cliff-core/src/repo.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-cliff-core/src/repo.rs b/git-cliff-core/src/repo.rs index 25d9a23baf..95843d7684 100644 --- a/git-cliff-core/src/repo.rs +++ b/git-cliff-core/src/repo.rs @@ -25,7 +25,8 @@ use url::Url; /// Regex for replacing the signature part of a tag message. static TAG_SIGNATURE_REGEX: Lazy = lazy_regex!( - r"(?s)-----BEGIN PGP SIGNATURE-----(.*?)-----END PGP SIGNATURE-----" + // https://git-scm.com/docs/gitformat-signature#_description + r"(?s)-----BEGIN (PGP|SSH|SIGNED) (SIGNATURE|MESSAGE)-----(.*?)-----END (PGP|SSH|SIGNED) (SIGNATURE|MESSAGE)-----" ); /// Wrapper for [`Repository`] type from git2.