From b6131581f1f1f07f630f02add2b49c8444d2594d Mon Sep 17 00:00:00 2001 From: Alex Blewitt Date: Mon, 17 Jun 2013 14:59:40 +0100 Subject: [PATCH] Add an option to selectively disable changeId The commit hook, if added, always adds a changeId to the bottom of the commit message. There is a configuration variable gerrit.createChangeId, which can be used to configure EGit to generate the changeId if specified. Respect the setting gerrit.createChangeId=false if the commit hook is set, in case standard tools always put the commit hook in place but it is not required for certain builds. This can be set at a global, or local change. Change-Id: I43a098453005fe0dcc60b6c4f6e4817f97ce24cf --- .../com/google/gerrit/server/tools/root/hooks/commit-msg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks/commit-msg b/gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks/commit-msg index b29e25c179..12dcd52642 100644 --- a/gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks/commit-msg +++ b/gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks/commit-msg @@ -38,6 +38,11 @@ add_ChangeId() { return fi + if test "false" = "`git config --bool --get gerrit.createChangeId`" + then + return + fi + # Does Change-Id: already exist? if so, exit (no change). if grep -i '^Change-Id:' "$MSG" >/dev/null then