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

Miklos Vajna vmiklos at collabora.co.uk
Wed Nov 27 00:17:51 PST 2013


 git-hooks/contrib/mso-dumper.git/hooks/update |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit cbddd8325c50eab71792838706dc6acfc8db6083
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Nov 27 09:17:11 2013 +0100

    git-hooks: mso-dumper is now on gerrit
    
    Change-Id: I7aed2559c122c384673e27d5533e4b546f0a21b1

diff --git a/git-hooks/contrib/mso-dumper.git/hooks/update b/git-hooks/contrib/mso-dumper.git/hooks/update
index 5abf97c..4308a20 100755
--- a/git-hooks/contrib/mso-dumper.git/hooks/update
+++ b/git-hooks/contrib/mso-dumper.git/hooks/update
@@ -9,11 +9,25 @@
 # (2) make this file executable by "chmod +x update".
 #
 
+# prevent pushing from anyone but the logerrit user
+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"
 
 ref_type=$(git cat-file -t "$3")
 
+# Avoid re-introducing obsolete tags
+if grep -q "^$1$" hooks/obsolete-tags; then
+	echo "*** Re-introducing an obsolete tag ($1) is not allowed in this repo" >&2
+	echo "*** Use corereleasebranches/killtagslocal.sh from contrib/dev-tools.git to get rid of them." >&2
+	exit 1
+fi
+
 # Only allow annotated tags in a shared repo
 # Remove this code to treat dumb tags the same as everything else
 case "$1","$ref_type" in
@@ -122,5 +136,5 @@ else
 		done
 fi |
 mail -s "$subject" -a "X-Git-Repository: git://anongit.freedesktop.org/git/libreoffice/contrib/mso-dumper.git" \
-     -a "List-Post: <mailto:libreoffice at lists.freedesktop.org>" $recipients
+     -a "List-Post: <mailto:libreoffice at lists.freedesktop.org>" -a "From: $from" $recipients
 exit 0


More information about the Libreoffice-commits mailing list