cfg/bin/git-c

31 lines
691 B
Text
Raw Normal View History

#!/bin/bash
set -euo pipefail
source "${HOME}/bin/script_framework.sh"
2016-10-19 15:25:32 +00:00
2016-10-19 15:20:54 +00:00
### Fix committer email by repo
step "Ensure correct commit config..."
git committerconfig
2016-10-19 15:20:54 +00:00
### Commit
signingkey=$(git config user.signingkey)
if [[ $signingkey =~ ^(ssh|ecdsa|key::) ]]; then
step "Loading ssh key into agent..."
vault-sshadd $(cut -d ' ' -f 3 <<<"${signingkey}")
else
step "Loading passphrase for GPG key..."
vault-gpg ${signingkey}
fi
2016-10-19 15:25:32 +00:00
step "Execute pre-commit auto-hook"
git autohook pre-commit
2016-10-19 15:25:32 +00:00
step "Issuing commit..."
COMMIT_OPTS=$(git config --get commit.cliopts 2>/dev/null || echo "")
git commit -v ${COMMIT_OPTS} "$@"
2016-07-21 13:48:49 +00:00
step "Execute post-commit auto-hook"
git autohook post-commit