You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On some systems the subject of a commit message is erroneously reported as not being capitalized.
$ git commit -m "Version update"
ERROR: commit message not properly formatted
- line 1: subject not capitalized
Version update
Continue anyway? [yes/no/edit] no
Cause
I don't know which systems or environments are affected but it seems that the problem is matching the subject line with a regular expression that uses a "traditional" character range:
[[ ${subject} =~ ^[a-z] ]]
This "usually" works but is dependent on at least the user's locale, especially the LC_COLLATE environment variable which can change what [a-z] means. On some systems it might mean [aAbBcC...] instead of the expected [abcd...] which makes it match uppercase letters as well.
Fix
The fix is as simple as replacing [a-z] in the regex with [[:lower:]] which is always interpreted as [abc...xyz]
The text was updated successfully, but these errors were encountered:
Description
On some systems the subject of a commit message is erroneously reported as not being capitalized.
Cause
I don't know which systems or environments are affected but it seems that the problem is matching the subject line with a regular expression that uses a "traditional" character range:
This "usually" works but is dependent on at least the user's locale, especially the
LC_COLLATE
environment variable which can change what[a-z]
means. On some systems it might mean[aAbBcC...]
instead of the expected[abcd...]
which makes it match uppercase letters as well.Fix
The fix is as simple as replacing
[a-z]
in the regex with[[:lower:]]
which is always interpreted as[abc...xyz]
The text was updated successfully, but these errors were encountered: