diff options
-rw-r--r-- | .config/git/cilium.io | 2 | ||||
-rwxr-xr-x | .config/git/hooks/with-signoff/prepare-commit-msg | 18 | ||||
-rw-r--r-- | .config/git/isovalent.com | 2 | ||||
-rw-r--r-- | .gitconfig | 4 |
4 files changed, 26 insertions, 0 deletions
diff --git a/.config/git/cilium.io b/.config/git/cilium.io index 0737a25..c33ba47 100644 --- a/.config/git/cilium.io +++ b/.config/git/cilium.io @@ -1,2 +1,4 @@ +[core] + hooksPath = ~/.config/git/hooks/with-signoff [user] email = tobias@cilium.io diff --git a/.config/git/hooks/with-signoff/prepare-commit-msg b/.config/git/hooks/with-signoff/prepare-commit-msg new file mode 100755 index 0000000..fd76931 --- /dev/null +++ b/.config/git/hooks/with-signoff/prepare-commit-msg @@ -0,0 +1,18 @@ +#!/bin/sh + +NAME=$(git config user.name) +EMAIL=$(git config user.email) + +if [ -z "$NAME" ]; then + echo "empty git config user.name" + exit 1 +fi + +if [ -z "$EMAIL" ]; then + echo "empty git config user.email" + exit 1 +fi + +git interpret-trailers --if-exists doNothing --trailer \ + "Signed-off-by: $NAME <$EMAIL>" \ + --in-place "$1" diff --git a/.config/git/isovalent.com b/.config/git/isovalent.com index 7501e19..6d982ba 100644 --- a/.config/git/isovalent.com +++ b/.config/git/isovalent.com @@ -1,2 +1,4 @@ +[core] + hooksPath = ~/.config/git/hooks/with-signoff [user] email = tobias@isovalent.com @@ -80,3 +80,7 @@ path = ~/.config/git/cilium.io [includeIf "gitdir:**/isovalent/*/"] path = ~/.config/git/isovalent.com +[includeIf "gitdir:**/cilium/*/"] + path = ~/.config/git/with-signoff-hook +[includeIf "gitdir:**/linux/.git"] + path = ~/.config/git/with-signoff-hook |