Message ID | 12ad49f9266b146b81f7c7347ec4d62d18602039.1597437024.git.leo@famulari.name |
---|---|
State | Accepted |
Headers | show |
Series | [bug#42868] maint: Only run `make authenticate` when pushing commits. | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
On Fri, Aug 14, 2020 at 04:30:47PM -0400, Leo Famulari wrote: > +z40=0000000000000000000000000000000000000000 > + > +# If deleting a branch, there are no commits to check. > +if [ "$local_sha" = $z40 ] > +then > + true > +else Is there a reason this `if' is written like that? I would use != and get rid of the do-nothing branch entirely. Regards, Jakub Kądziołka
Hi, Leo Famulari <leo@famulari.name> skribis: > 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. I agree with Jakub regarding the ‘if’ :-), but other than that it LGTM. Thanks! Ludo’.
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