From dad1c7bbb3233130d6a71291d5d0ae437e87a028 Mon Sep 17 00:00:00 2001 From: earnest ma Date: Wed, 8 Dec 2021 15:11:17 -0500 Subject: [PATCH] git hooks: Add pre-push --- git/.config/git/hooks/pre-push | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 git/.config/git/hooks/pre-push diff --git a/git/.config/git/hooks/pre-push b/git/.config/git/hooks/pre-push new file mode 100755 index 0000000..70420fa --- /dev/null +++ b/git/.config/git/hooks/pre-push @@ -0,0 +1,13 @@ +#!/bin/sh +# Copyright (c) 2021 Sebastian LaVine +# This file is licensed under the MIT license. See LICENSE at +# for more details. +# A simple git pre-push hook to prevent possibly bad code from being pushed + +# Don't allow a push to go through if it is between midnight and 07:00am. +if [ "$(date +%H)" -lt 07 ]; then + printf "%s\n%s\n" \ + "Woah there! It's a little late to be writing good code," \ + "don't you think? Why don't you try this again in the morning." + exit 1 +fi