[coreboot] New patch to review for coreboot: 281a6b1 gitconfig: Give up commiting when non-ascii character is in commit message.

Zheng Bao (zheng.bao@amd.com) gerrit at coreboot.org
Tue Feb 26 07:44:53 CET 2013


Zheng Bao (zheng.bao at amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2524

-gerrit

commit 281a6b1b4bd4257044d436b5a714379677717b5e
Author: Zheng Bao <fishbaozi at gmail.com>
Date:   Tue Feb 26 14:48:57 2013 +0800

    gitconfig: Give up commiting when non-ascii character is in commit message.
    
    ' ' is 0x20, '~' is 0x7E. The character not between ' ' and '~' could be
    treated as non-ascii one, which makes the project less global.
    
    Change-Id: If0bbc4bb6b1f8a0d123d00e2b8e6b29cc78abda0
    Signed-off-by: Zheng Bao <zheng.bao at amd.com>
    Signed-off-by: Zheng Bao <fishbaozi at gmail.com>
---
 util/gitconfig/commit-msg | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/util/gitconfig/commit-msg b/util/gitconfig/commit-msg
index 1a4e865..c1e1893 100755
--- a/util/gitconfig/commit-msg
+++ b/util/gitconfig/commit-msg
@@ -37,6 +37,12 @@ add_ChangeId() {
 		exit 1
 	fi
 
+	if LANG= grep '[^ -~]' "$MSG" > /dev/null
+	then
+		echo "Aborting commit due to non-ascii characters in commit message."
+		exit 1
+	fi
+
 	# Does Change-Id: already exist? if so, exit (no change).
 	if grep -i '^Change-Id: I[0-9a-f]\{40\}$' "$MSG" >/dev/null
 	then



More information about the coreboot mailing list