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 | |
Neels Hofmeyr | f486870 | 2021-06-22 00:35:42 +0200 | [diff] [blame] | 13 | for r in $(find . -maxdepth 2 -name '.git'); do |
Neels Hofmeyr | 8bf0339 | 2017-08-31 00:02:03 +0200 | [diff] [blame] | 14 | cd "$base/$r" |
| 15 | if [ ! -f "hooks/commit-msg" ]; then |
Vadim Yanitskiy | 2fef4e5 | 2022-04-19 20:30:09 +0300 | [diff] [blame] | 16 | scp -P 29418 gerrit.osmocom.org:hooks/commit-msg hooks/ |
Neels Hofmeyr | 8bf0339 | 2017-08-31 00:02:03 +0200 | [diff] [blame] | 17 | fi |
| 18 | sed -i 's/if (unprinted /if (0 \&\& unprinted /' hooks/commit-msg |
| 19 | done |