[hooks PATCH] Don't allow @localhost email addresses in commit message

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

 



Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 update | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/update b/update
index 247b008..966fe22 100755
--- a/update
+++ b/update
@@ -264,6 +264,19 @@ if [ $check_diff = yes ]; then
 			fi
 		done
 	fi
+
+	allow_localhost_email=$(git config --bool hooks.allowlocalhostemail)
+	if [ "$allow_localhost_email" != "true" ]; then
+		for rev in `git log --format=%h $oldrev..$newrev`
+		do
+			git show $rev | grep '@localhost' >/dev/null 2>&1
+			if test $? != 0
+			then
+				echo "*** Update hook: @localhost email address is forbidden $rev" >&2
+				exit 1
+			fi
+		done
+	fi
 fi
 
 # --- Finished
-- 
2.24.1





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux