[sysadmin-bin: 79/168] Bypass commit sanity checks during import and for --exec=force



commit c0de06b99be527ad72183a92f77987af47fb794b
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Apr 16 12:20:26 2009 -0400

    Bypass commit sanity checks during import and for --exec=force
    
    Don't check Author: and for extraneous merges during import and
    when --exec=force is passed by a gitadmin.

 pre-receive-check-policy |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/pre-receive-check-policy b/pre-receive-check-policy
index e2c6ddc..0e9fadd 100755
--- a/pre-receive-check-policy
+++ b/pre-receive-check-policy
@@ -28,7 +28,8 @@ check_commit() {
     email="$(git log $commit -1 --pretty=format:%ae)"
     case "$email" in
 	*localhost.localdomain|*\(none\))
-	    cat <<EOF >&2
+	    if ! in_import && ! forced ; then
+		cat <<EOF >&2
 ---
 The commits you are trying to push contain the author email
 address '$email'. Please configure your
@@ -40,12 +41,14 @@ For instructions about how to do this and how to fix your
 existing commits.
 ---
 EOF
-	    exit 1
-	;;
+		exit 1
+	    fi
+	    ;;
     esac
 
     subject="$(git log $commit -1 --pretty=format:%s)"
     if expr "$subject" : ".*Merge branch.*of.*\(git\|ssh\):" > /dev/null 2>&1; then
+	if ! in_import && ! forced ; then
 	    cat <<EOF >&2
 ---
 The commit:
@@ -62,6 +65,7 @@ will fix the problem. Then please try, 'git push' again. Please see:
 ---
 EOF
 	    exit 1
+	fi
     fi
 }
 



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