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:
parent
cc3ca421aa
commit
610382ddfd
@ -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
|
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/
|
cp ./gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks/commit-msg .git/hooks/
|
||||||
chmod +x .git/hooks/commit-msg
|
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:
|
To set up git's remote for easy pushing, run the following:
|
||||||
|
|
||||||
====
|
====
|
||||||
|
Loading…
Reference in New Issue
Block a user