[sysadmin-bin: 60/168] Suppress notifications for pending repositories



commit e78620b407ef1cd55311751045683d4fa5dfef18
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Mar 19 19:14:20 2009 -0400

    Suppress notifications for pending repositories
    
    When a repository is being imported, don't send out email or
    CIA notifications.

 gnome-post-receive-email |    4 ++++
 post-receive-notify-cia  |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gnome-post-receive-email b/gnome-post-receive-email
index 6152e32..016cfa3 100755
--- a/gnome-post-receive-email
+++ b/gnome-post-receive-email
@@ -1114,6 +1114,10 @@ def main():
     except CalledProcessError:
         die("GIT_DIR not set")
 
+    # No emails for a repository in the process of being imported
+    if os.path.exists(os.path.join(git_dir, 'pending')):
+        return
+
     # Use the directory name with .git stripped as a short identifier
     absdir = os.path.abspath(git_dir)
     projectshort = os.path.basename(absdir)
diff --git a/post-receive-notify-cia b/post-receive-notify-cia
index 5a90ef2..f73d69b 100755
--- a/post-receive-notify-cia
+++ b/post-receive-notify-cia
@@ -13,6 +13,11 @@ if [ -z "$GIT_DIR" ]; then
 	exit 1
 fi
 
+# Don't notify for a repository in the process of being imported
+if [ -e "$GIT_DIR/pending" ] ; then
+    exit 0
+fi
+
 # We figure out the module from the directory name with .git stripped. Then
 # pass that to ciabot.pl as an environment variable. (We use an environment
 # variable to get a minimal delta from upstream ciabot.pl.)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]