From 4760314f775002a11be872bc8c7e9cbd55af321c Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 25 Jul 2014 00:53:03 +0400 Subject: [PATCH] Add scripts to put phd public key to an orphaned branch --- add-pubkey/add-pubkey | 8 ++++++++ add-pubkey/post-checkout | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 add-pubkey/add-pubkey create mode 100755 add-pubkey/post-checkout diff --git a/add-pubkey/add-pubkey b/add-pubkey/add-pubkey new file mode 100755 index 0000000..b47464f --- /dev/null +++ b/add-pubkey/add-pubkey @@ -0,0 +1,8 @@ +#! /bin/sh + +git checkout --orphan phd-pubkey && +git rm -rf \* && git clean -d -f -q && + +gpg --export phd@phdru.name >phd-public-key-B6287B03 && +git add phd-public-key-B6287B03 && +git commit -m phd-public-key-B6287B03 diff --git a/add-pubkey/post-checkout b/add-pubkey/post-checkout new file mode 100755 index 0000000..ae91c71 --- /dev/null +++ b/add-pubkey/post-checkout @@ -0,0 +1,20 @@ +#!/bin/sh + +# post-checkout hook that compiles python files to byte code +# if branch was changed or remove byte code files for a specific branch + +prev_HEAD="$1" +new_HEAD="$2" +new_branch="$3" + +if [ \( "$new_branch" = 1 \) ]; then + phd_pubkey_HEAD="`git show-ref --hash refs/heads/phd-pubkey`" + if [ "$new_HEAD" = "$phd_pubkey_HEAD" ]; then + git clean -d -f -q + else + python2.7 -m compileall -q . && + python2.7 -O -m compileall -q . + fi +fi + +exit 0 -- 2.39.5