]> git.phdru.name Git - git-scripts.git/blobdiff - configure-sf
Always set emailprefix even if it's empty
[git-scripts.git] / configure-sf
index 7ab51f6950eba0131f5771fcb6524f9bade8efc7..796e510c791723193a0a1dafc147a6c1cc1af18d 100755 (executable)
@@ -1,13 +1,17 @@
 #! /bin/sh
 
+# Origin: http://blog.gorwits.me.uk/index.html%3Fp=529.html
+
 if [ -z "$3" ]; then
-   echo "Usage: $0 PROJECTNAME REPONAME MLIST" >&2
+   echo "Usage: $0 PROJECTNAME REPONAME MLIST prefix [maxlines]" >&2
    exit 1
 fi
 
 PROJECTNAME="$1"
 REPONAME="$2"
 MLIST="$3"
+prefix="$4"
+maxlines="$5"
 
 cd /home/git/p/"$PROJECTNAME/$REPONAME".git &&
 echo "$PROJECTNAME git repository ($REPONAME)" > description
@@ -20,8 +24,10 @@ chmod +x hooks/post-receive-user &&
 #chmod g+w hooks/post-receive-user &&
 
 git config hooks.diffopts "--stat --summary --find-copies-harder -p"
-git config hooks.emailmaxlines 500 &&
-git config hooks.emailprefix "[git push]" &&
+if [ -n "$maxlines" ]; then
+   git config hooks.emailmaxlines "$maxlines" &&
+fi &&
+git config hooks.emailprefix "$prefix" &&
 git config hooks.envelopesender noreply@sourceforge.net &&
 git config hooks.mailinglist $MLIST@lists.sourceforge.net
-#git config hooks.showrev "t=%s; printf 'http://$PROJECTNAME.git.sourceforge.net/git/gitweb.cgi?p=$PROJECTNAME/$REPONAME;a=commitdiff;h=%%s' ; echo;echo; git show -C ; echo"
+#git config hooks.showrev "t=%s; printf 'http://$PROJECTNAME.git.sourceforge.net/git/gitweb.cgi?p=$PROJECTNAME/$REPONAME;a=commitdiff;h=%%s' \$t; echo;echo; git show -C \$t; echo"