Skip to content

Conversation

gadfly3173
Copy link
Contributor

  • Adjust the SHA regex pattern to match commit hashes with a minimum length of 6 characters instead of 10.

The minimum length of a Git commit ID can be 4 hexadecimal characters. Considering that Diff.cs uses a 6-40 character string for validation, the check for commit IDs in the commit message has been shortened to 6 characters. For example, GitHub considers a 7-character string as a valid commit ID.

- Adjust the SHA regex pattern to match commit hashes with a minimum length of 6 characters instead of 10.
@love-linger
Copy link
Collaborator

It's because that some issue tracker system also uses 6-8 hex characters.

@gadfly3173
Copy link
Contributor Author

As far as I know, Gitee use #I[5 characters], YouTrack and Jira use [Project]-[number], and CommitMessagePresenter will not check the parts processed by IssueTrackerRule again. Or can we consider changing the check here to 7 characters?

@love-linger love-linger self-assigned this Feb 6, 2025
@love-linger love-linger added the enhancement New feature or request label Feb 6, 2025
@love-linger love-linger merged commit 65a9406 into sourcegit-scm:develop Feb 6, 2025
13 checks passed
@gadfly3173 gadfly3173 deleted the fix/commit-id branch February 6, 2025 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants