Also added a missing colon that caused my bash 4.2.45(2)-release to
complain about an empty if.
Signed-off-by: Sebastian Götte <ja...@physik-pool.tu-berlin.de>
templates/hooks--pre-push.sample | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample
old mode 100644
new mode 100755
@@ -1,6 +1,6 @@
-# An example hook script to verify what is about to be pushed. Called by "git
+# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
@@ -14,22 +14,22 @@
# Information about the commits which are being pushed is supplied as lines to
# the standard input in the form:
-# <local ref> <local sha1> <remote ref> <remote sha1>
+# <local ref> <local sha1> <remote ref> <remote sha1>
-# This sample shows how to prevent push of commits where the log message starts
-# with "WIP" (work in progress).
+# This sample shows how to prevent pushing commits without good GPG signatures
+# or where the log message starts with "WIP" (work in progress).
while read local_ref local_sha remote_ref remote_sha
if [ "$local_sha" = $z40 ]
- # Handle delete
+ : # Handle delete
if [ "$remote_sha" = $z40 ]
@@ -45,9 +45,16 @@ do
if [ -n "$commit" ]
echo "Found WIP commit in $local_ref, not pushing"
- exit 1
+ # Check for missing good GPG signatures
+ for commit in `git log --format="%G? %h" "$range" | grep -v
'^G' | cut -d\ -f2`
+ echo "Commit $commit does not have a good GPG signature"
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html