Skip to content

Commit

Permalink
feat: Skip ssh and x509 signatures in tag messages
Browse files Browse the repository at this point in the history
Git supports SSH and x509 signatures in addition to GPG signatures.
See <https://git-scm.com/docs/gitformat-signature#_description>.

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).
  • Loading branch information
PigeonF committed Jul 6, 2024
1 parent 227a307 commit 09e7650
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-cliff-core/src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ use url::Url;

/// Regex for replacing the signature part of a tag message.
static TAG_SIGNATURE_REGEX: Lazy<Regex> = 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.
Expand Down

0 comments on commit 09e7650

Please sign in to comment.