[Libreoffice-commits] dev-tools.git: git-hooks/contrib

Miklos Vajna vmiklos at suse.cz
Wed May 15 02:07:12 PDT 2013


 git-hooks/contrib/buildbot.git/hooks/update |   24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

New commits:
commit c0545eff5f50cb2932c9b34ed00e6aaf09740d67
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed May 15 11:06:46 2013 +0200

    git-hooks: sync core -> buildbot hook
    
    Change-Id: If9481f340fad1263b00b4a467b265fdabeae9c7c

diff --git a/git-hooks/contrib/buildbot.git/hooks/update b/git-hooks/contrib/buildbot.git/hooks/update
index c935005..ac84fcf 100755
--- a/git-hooks/contrib/buildbot.git/hooks/update
+++ b/git-hooks/contrib/buildbot.git/hooks/update
@@ -14,6 +14,7 @@ if [ "$(id -u -n )" != "logerrit" ] ; then
        echo "*** The reference for this repo is gerrit. do not push directly to fdo" >&2
        exit 1
 fi
+from="$(git show -s --pretty=format:'%an <%ae>' $3^{})"
 
 project=$(cat $GIT_DIR/description)
 recipients="libreoffice-commits at lists.freedesktop.org"
@@ -47,8 +48,9 @@ date_format="%F %R %z"
 num_path_components=2
 
 # Set subject
+repo=$(basename $(cd $GIT_DIR ; pwd))
 if expr "$2" : '0*$' >/dev/null ; then
-	subject="Changes to '${1##refs/heads/}'"
+	subject="$repo: Changes to '${1##refs/heads/}'"
 else
 	base=$(git-merge-base "$2" "$3")
 	subject=$(git-diff-tree -r --name-only "$base" "$3" |
@@ -61,6 +63,7 @@ else
 	if [ "$branch" != "master" ] ; then
 		subject="Branch '$branch' - $subject"
 	fi
+	subject="$repo: $subject"
 fi
 
 if expr "$2" : '0*$' >/dev/null
@@ -109,7 +112,22 @@ else
 		echo "Rebased ref, commits from common ancestor:"
 		;;
 	esac
-	git-rev-list "$3" "^$base" | while read rev; do git-show $rev; done
+	bytes=0
+	IFS="$(echo)"
+	git-rev-list "$3" "^$base" | while read rev; do git-show -M $rev; done | sed 's#\\#\\\\#g' |
+		while read line
+		do
+			if [ "$bytes" -ge "0" ] ; then
+				bytes=$(( $bytes + ${#line} + 1 ))
+				if [ "$bytes" -gt "100000" ] ; then
+					bytes=-1
+					echo -e "\n... etc. - the rest is truncated"
+				else
+					echo "$line"
+				fi
+			fi
+		done
 fi |
-mail -s "$subject" -a "X-Git-Repository: git://anongit.freedesktop.org/git/ooo-build/ooo-build" $recipients
+mail -s "$subject" -a "X-Git-Repository: git://anongit.freedesktop.org/git/libreoffice/contrib/buildbot.git" \
+     -a "List-Post: <mailto:libreoffice at lists.freedesktop.org>" -a "From: $from" $recipients
 exit 0


More information about the Libreoffice-commits mailing list