]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Add ProjectContact script
authorJunio C Hamano <gitster@pobox.com>
Tue, 17 Feb 2009 07:52:02 +0000 (23:52 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Feb 2009 07:52:02 +0000 (23:52 -0800)
ProjectContact [new file with mode: 0755]

diff --git a/ProjectContact b/ProjectContact
new file mode 100755 (executable)
index 0000000..4a5d035
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+header=
+while :
+do
+       case $# in 0) break ;; esac
+       case "$1" in
+       -b)     header=Bcc ;;
+       -c)     header=Cc ;;
+       -*)     echo >&2 "Unknown option $1"
+               exit 1 ;;
+       *)      break ;;
+       esac
+       shift
+done
+
+case $# in
+0) match='*' ;;
+1) match="*$1*"; shift ;;
+esac
+for p
+do
+       match="$match|*$p*"
+done
+
+{
+iis=
+iis2=',
+ '
+while read address name
+do
+       case "$name" in
+       $match) ;;
+       *)      continue ;;
+       esac
+       item="$name <$address>"
+       if test -z "$header"
+       then
+               echo "$iis$item"
+       elif test -z "$iis"
+       then
+               printf "$header: $item"
+               iis="$iis2"
+       else
+               printf "$iis$item"
+       fi
+done
+if test -n "$header"
+then
+       printf '\n'
+fi
+} <<\EOF
+linux-kernel@vger.kernel.org   Linux Kernel
+info@lwn.net                   LWN.NET
+emacs-orgmode@gnu.org          Emacs Org Mode
+EOF