summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-10-18 17:35:51 +0200
committerMichał Górny <mgorny@gentoo.org>2019-04-09 13:05:55 +0200
commit9c94d44fee50b6e92210aded37ef841e6701c7ed (patch)
treea036a6fdb03fb47f9fce56f165ad372e24deea23
parentupdate-04-utf8: Add tests (diff)
downloadgithooks-9c94d44fee50b6e92210aded37ef841e6701c7ed.tar.gz
githooks-9c94d44fee50b6e92210aded37ef841e6701c7ed.tar.bz2
githooks-9c94d44fee50b6e92210aded37ef841e6701c7ed.zip
update-06-copyright: Allow for comments in S-o-b
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rwxr-xr-xlocal/tests/update-06-copyright.sh6
-rwxr-xr-xlocal/update-06-copyright6
2 files changed, 11 insertions, 1 deletions
diff --git a/local/tests/update-06-copyright.sh b/local/tests/update-06-copyright.sh
index a8816e0..0e0d3be 100755
--- a/local/tests/update-06-copyright.sh
+++ b/local/tests/update-06-copyright.sh
@@ -201,6 +201,12 @@ git commit --allow-empty -m "A commit
Signed-off-by: ${GIT_COMMITTER_NAME^^} <${GIT_COMMITTER_EMAIL^^}>" -q
test_success
+tbegin "Comment after realname"
+git commit --allow-empty -m "A commit
+
+Signed-off-by: ${GIT_COMMITTER_NAME} (foobarbaz) <${GIT_COMMITTER_EMAIL}>" -q
+test_success
+
eoutdent
export GIT_AUTHOR_NAME='Somebody Else'
diff --git a/local/update-06-copyright b/local/update-06-copyright
index ffc3d96..90b6a66 100755
--- a/local/update-06-copyright
+++ b/local/update-06-copyright
@@ -112,8 +112,12 @@ while read -r commithash; do
# require either CN or GECOS to match (to allow
# for ASCII spelling)
+ # also allow for a single comment after the name
+ # e.g. for nickname, requested by jmbsvicetto
if [[ ${realname} != "${cn_expected}" \
- && ${realname} != "${gecos_expected}" ]]
+ && ${realname} != "${gecos_expected}" \
+ && ${realname% (*} != "${cn_expected}" \
+ && ${realname% (*} != "${gecos_expected}" ]]
then
signoff=diffname
break