all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo Famulari <leo@famulari.name>
To: 42868@debbugs.gnu.org
Subject: [bug#42868] [PATCH] maint: Only run `make authenticate` when pushing commits.
Date: Fri, 14 Aug 2020 16:30:47 -0400	[thread overview]
Message-ID: <12ad49f9266b146b81f7c7347ec4d62d18602039.1597437024.git.leo@famulari.name> (raw)

When deleting a remote branch, no commits are pushed to the remote, and
thus there are no signatures to be verified.

* etc/git/pre-push: Exit early when deleting a branch.
---
 etc/git/pre-push | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/etc/git/pre-push b/etc/git/pre-push
index 415345fc75..689673dcc9 100755
--- a/etc/git/pre-push
+++ b/etc/git/pre-push
@@ -20,13 +20,21 @@
 #
 #   <local ref> <local sha1> <remote ref> <remote sha1>
 
-# Only use the hook when pushing to Savannah.
-case "$2" in
-    *.gnu.org*)
-	exec make authenticate check-channel-news
-	exit 127
-	;;
-    *)
-	exit 0
-	;;
-esac
+z40=0000000000000000000000000000000000000000
+
+# If deleting a branch, there are no commits to check.
+if [ "$local_sha" = $z40 ]
+then
+	true
+else
+	# Only use the hook when pushing to Savannah.
+	case "$2" in
+	    *.gnu.org*)
+		exec make authenticate check-channel-news
+		exit 127
+		;;
+	    *)
+		exit 0
+		;;
+	esac
+fi
-- 
2.28.0





             reply	other threads:[~2020-08-14 20:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-14 20:30 Leo Famulari [this message]
2020-08-19 22:29 ` [bug#42868] [PATCH] maint: Only run `make authenticate` when pushing commits Jakub Kądziołka
2020-08-30 19:47 ` Ludovic Courtès
2020-12-13 20:35   ` Leo Famulari
2020-12-14  8:28     ` Ludovic Courtès
2020-12-14 17:17       ` bug#42868: " Leo Famulari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12ad49f9266b146b81f7c7347ec4d62d18602039.1597437024.git.leo@famulari.name \
    --to=leo@famulari.name \
    --cc=42868@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.