Document how to set commit-msg hook for plugin submodules

The commit-msg hook in .git/hooks is not used when making commits
on gits that are included as git submodules.  The hook also needs
to be installed in the submodules' hooks folder.

Update dev-contributing to mention this.

Change-Id: I8cfc2eb30409e113a1c1757fbe4629875067d334
This commit is contained in:
David Pursehouse 2013-05-23 16:42:12 +09:00
parent cc3ca421aa
commit 610382ddfd

View File

@ -94,13 +94,22 @@ A sample good Gerrit commit message:
====
The Change-Id is, as usual, created by a local git hook. To install it, simply
copy one from the checkout and make it executable:
copy it from the checkout and make it executable:
====
cp ./gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks/commit-msg .git/hooks/
chmod +x .git/hooks/commit-msg
====
If you are working on core plugins, you will also need to install the
same hook in the submodules:
====
export hook=$(pwd)/.git/hooks/commit-msg
git submodule foreach 'cp -p "$hook" "$(git rev-parse --git-dir)/hooks/"'
====
To set up git's remote for easy pushing, run the following:
====