2 recipients="root+git" # adresse pour l'envoi du mail
3 # On modifie un peu la sortie de git show :
4 # 1) on insère "git hostname - " devant le nom en From:
5 # 2) on remplace "[PATCH]" par "git-commit:" dans le champ Subject:
6 # 3) on ajoute un champ To:
7 # 4) on ajoute un champ Content-Type:
8 # et on envoie le tout via sendmail
9 PATH=/usr/sbin:/usr/bin:/sbin:/bin
10 git show --pretty=email |
11 sed -e '1,6s/^From: /From: git '`hostname -f`' - /' \
12 -e '1,6s/^Subject: \[PATCH\]/Subject: git-commit:/' \
13 -e '3iTo: '"${recipients}" \
14 -e '4iContent-Type: text/plain; charset=utf-8' |
15 head -c 16k | /usr/sbin/sendmail ${recipients}