2017-08-30 22:02:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Look for git repositories in and below the current dir and install the gerrit
|
|
|
|
# commit-msg hook in each one.
|
|
|
|
# Tweak the commit hook to always place the 'Change-Id' at the bottom.
|
|
|
|
# This requires an ~/.ssh/config entry like
|
|
|
|
# host go
|
|
|
|
# hostname gerrit.osmocom.org
|
|
|
|
# port 29418
|
|
|
|
|
|
|
|
set -x
|
|
|
|
base="$PWD"
|
|
|
|
|
2021-06-21 22:35:42 +00:00
|
|
|
for r in $(find . -maxdepth 2 -name '.git'); do
|
2017-08-30 22:02:03 +00:00
|
|
|
cd "$base/$r"
|
|
|
|
if [ ! -f "hooks/commit-msg" ]; then
|
2022-04-19 17:30:09 +00:00
|
|
|
scp -P 29418 gerrit.osmocom.org:hooks/commit-msg hooks/
|
2017-08-30 22:02:03 +00:00
|
|
|
fi
|
|
|
|
sed -i 's/if (unprinted /if (0 \&\& unprinted /' hooks/commit-msg
|
|
|
|
done
|