blob: b03c88c2624b31501c254ba6203256b55a163338 [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
13for 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
19done