diff options
author | Parabola git <git@parabola.nu> | 2020-12-15 14:00:02 +0000 |
---|---|---|
committer | Parabola git <git@parabola.nu> | 2020-12-15 14:00:02 +0000 |
commit | c823653b498d603f287523f3ac95670a7509588e (patch) | |
tree | 675af37f42685d96d7f4ab3d6a4250c6a6957350 | |
parent | 5acc2bb7fad592a58c2932314384c39843859355 (diff) |
Update from cron
-rwxr-xr-x | .config/git/hooks/post-receive.d/notify-pbot-git-hook | 6 | ||||
-rwxr-xr-x | .config/git/hooks/update.d/per-branch-no-ff | 14 |
2 files changed, 11 insertions, 9 deletions
diff --git a/.config/git/hooks/post-receive.d/notify-pbot-git-hook b/.config/git/hooks/post-receive.d/notify-pbot-git-hook index 4a336c8..aae5687 100755 --- a/.config/git/hooks/post-receive.d/notify-pbot-git-hook +++ b/.config/git/hooks/post-receive.d/notify-pbot-git-hook @@ -30,11 +30,11 @@ ## constants ## +readonly REPO=$(basename $(pwd)) readonly LIB_DIR=/usr/lib/parabola-hackers readonly LOG_DIR=/var/log/pbot -readonly LOG_FILE=${LOG_DIR}/notify-pbot-$(date +%Y.%m.%d-%H.%M.%S)-${REPO} +readonly LOG_FILE=${LOG_DIR}/notify-pbot-$(date +%Y-%m-%d_%H-%M-%S)_${REPO} readonly SHA_REGEX='^([0-9a-f]{40})$' -readonly REPO=$(basename $(pwd)) ## logging ## @@ -93,4 +93,4 @@ ParseRefData() # (prev_sha curr_sha ref_file) ## main entry ## -while read ref_data ; do echo pbot-say "$(ParseRefData ${ref_data})" ; sleep 2 ; done ; +while read ref_data ; do pbot-say "$(ParseRefData ${ref_data})" ; sleep 2 ; done ; diff --git a/.config/git/hooks/update.d/per-branch-no-ff b/.config/git/hooks/update.d/per-branch-no-ff index 1e40921..9551fcf 100755 --- a/.config/git/hooks/update.d/per-branch-no-ff +++ b/.config/git/hooks/update.d/per-branch-no-ff @@ -1,12 +1,14 @@ #!/bin/bash -ref=$1 -prev_sha=$2 -next_sha=$3 +readonly REPO=$(basename $(pwd)) +readonly REF=$1 +readonly PREV_SHA=$2 +readonly NEXT_SHA=$3 -# prevent re-writing history on master branch +# prevent re-writing history on abslibre master branch # autobuilder can not handle non-fast-forward commits -[[ "${ref}" != 'refs/heads/master' ]] || \ -git merge-base --is-ancestor "${prev_sha}" "${next_sha}" +[[ "${REPO}" != 'abslibre.git' ]] || \ +[[ "${REF}" != 'refs/heads/master' ]] || \ +git merge-base --is-ancestor "${PREV_SHA}" "${NEXT_SHA}" exit $? |