This patch changes the pre-commit hook to check whether more than one person has signed off/acked a patch. If that is not the case, it will output a warning, but the commit will not fail. It is possible to amend this hook to check for triviality of patches later, but for now the warning is better than nothing.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
---
--- pre-commit~ 2007-10-02 18:19:16.000000000 +0200 +++ pre-commit 2007-10-02 18:36:12.000000000 +0200 @@ -72,7 +72,6 @@ exit 1; }
- $SVNLOOK log -t "$TXN" "$REPOS" | \ grep -i "Acked-by: .*@.*$" > /dev/null || { echo "commit is not reviewed by anyone. sorry." >&2 @@ -80,6 +79,15 @@ exit 1; }
+$SVNLOOK log -t "$TXN" "$REPOS" | \ + grep -i "Signed-off-by: .*@.*$|Acked-by: .*@.*$" | \ + sed "s/.*-by://;s/^[[:blank:]]*//;s/[[:blank:]]*$//" | \ + sort -u|wc -l|xargs test 1 -eq >/dev/null && { + echo "Commit has not been signed off/acked by more than one person." >&2 + echo "This is allowed only for trivial patches." >&2 + #FIXME: Check whether the patch is trivial, for now don't fail + } +
# Check that the author of this commit has the rights to perform # the commit on the files and directories being modified.