blob: 05f1b90ecf66539b149f3b1c0083381a313f6f5c [file] [log] [blame]
Neels Hofmeyr8bf03392017-08-31 00:02:03 +02001#!/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
10set -x
11base="$PWD"
12
Neels Hofmeyrf4868702021-06-22 00:35:42 +020013for r in $(find . -maxdepth 2 -name '.git'); do
Neels Hofmeyr8bf03392017-08-31 00:02:03 +020014 cd "$base/$r"
15 if [ ! -f "hooks/commit-msg" ]; then
Vadim Yanitskiy2fef4e52022-04-19 20:30:09 +030016 scp -P 29418 gerrit.osmocom.org:hooks/commit-msg hooks/
Neels Hofmeyr8bf03392017-08-31 00:02:03 +020017 fi
18 sed -i 's/if (unprinted /if (0 \&\& unprinted /' hooks/commit-msg
19done