[sysadmin-bin] cgit leftovers



commit eaa7b9af1256e936dc014a392bcd8c0ab97a1fd5
Author: Andrea Veri <averi redhat com>
Date:   Fri Sep 10 11:43:54 2021 +0200

    cgit leftovers

 git/pre-receive-check-policy | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)
---
diff --git a/git/pre-receive-check-policy b/git/pre-receive-check-policy
index 088a7cc..cc4f2ec 100755
--- a/git/pre-receive-check-policy
+++ b/git/pre-receive-check-policy
@@ -16,17 +16,12 @@ server=gitlab.gnome.org
 mainline=$(git symbolic-ref --quiet --short HEAD)
 mainline=${mainline:-"master"}
 
-forced() {
-    test -n "$GNOME_GIT_FORCE"
-}
-
 check_commit() {
     commit=$1
 
     email="$(git log $commit -1 --pretty=format:%ae)"
     case "$email" in
     *localhost.localdomain|*\(none\))
-        if ! forced ; then
         cat <<- EOF >&2
             ---
             The commits you are trying to push contain the author email
@@ -40,13 +35,11 @@ check_commit() {
             ---
         EOF
         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 ! forced ; then
         cat <<- EOF >&2
             ---
             The commit:
@@ -64,11 +57,9 @@ check_commit() {
         EOF
         exit 1
     fi
-    fi
 
     body="$(git log $commit -1 --pretty=format:%b)"
     if expr "$body" : ".*FIXME: need commit message" > /dev/null 2>&1; then
-    if ! forced ; then
         cat <<- EOF >&2
             ---
             The commit:
@@ -82,7 +73,6 @@ check_commit() {
             (for an older commit) 'git rebase -i'. Then try 'git push' again.
             EOF
         exit 1
-        fi
     fi
 
 }
@@ -202,7 +192,6 @@ check_ref_update() {
             commit)
                 # Lightweight tag; we allow an import containing these
                 # tags, but forbid them in general
-                if ! forced ; then
                 cat <<- EOF >&2
                     ---
                     You are trying to push the lightweight tag '$tagname'. You should either
@@ -212,7 +201,6 @@ check_ref_update() {
                     ---
                     EOF
                 exit 1
-                fi
                 ;;
             tag)
                 # Annotated tag
@@ -244,7 +232,7 @@ check_ref_update() {
             # or whatever. An exception to above rule is deleting tag named
             # HEAD. There are some projects which created such tag before 
             # rejecting its creation was added to policy.
-            if ! forced && [ 'x'"$tagname" != 'xHEAD' ] ; then
+            if [ 'x'"$tagname" != 'xHEAD' ] ; then
             cat <<- EOF >&2
                 ---
                 You are trying to delete the tag '$tagname'.
@@ -256,7 +244,6 @@ check_ref_update() {
             fi
             ;;
         update)
-            if  ! forced ; then
             cat <<- EOF >&2
                 ---
                 You are trying to replace the tag '$tagname' with a new tag. Please see:
@@ -265,7 +252,6 @@ check_ref_update() {
                 ---
                 EOF
             exit 1
-            fi
             ;;
         esac
         ;;
@@ -300,7 +286,7 @@ check_ref_update() {
             fi
             ;;
         update)
-            if [ "`git merge-base $oldrev $newrev`" != $oldrev ] && ! forced ; then
+            if [ "`git merge-base $oldrev $newrev`" != $oldrev ] ; then
             # Non-fast-forward update. Right now we have
             # receive.denyNonFastforwards in the git configs for
             # our repositories anyways, but catching it here would


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