Neels Hofmeyr | 8bf0339 | 2017-08-31 00:02:03 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Look for git repositories in and below the current dir and install the gerrit |
| 3 | # commit-msg hook in each one. |
| 4 | # Tweak the commit hook to always place the 'Change-Id' at the bottom. |
| 5 | # This requires an ~/.ssh/config entry like |
| 6 | # host go |
| 7 | # hostname gerrit.osmocom.org |
| 8 | # port 29418 |
| 9 | |
| 10 | set -x |
| 11 | base="$PWD" |
| 12 | |
| 13 | for r in $(find . -name '.git'); do |
| 14 | cd "$base/$r" |
| 15 | if [ ! -f "hooks/commit-msg" ]; then |
| 16 | scp go:hooks/commit-msg hooks/ |
| 17 | fi |
| 18 | sed -i 's/if (unprinted /if (0 \&\& unprinted /' hooks/commit-msg |
| 19 | done |