2017-11-10 11:44:57 +00:00
|
|
|
#!/bin/bash
|
2017-12-15 11:29:57 +00:00
|
|
|
set -euo pipefail
|
2017-07-17 09:55:39 +00:00
|
|
|
|
2017-09-19 10:10:53 +00:00
|
|
|
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
|
|
|
|
|
2017-11-10 11:44:57 +00:00
|
|
|
step "Ensure correct commit config..."
|
|
|
|
git committerconfig
|
2016-10-19 15:20:54 +00:00
|
|
|
|
|
|
|
### Commit
|
|
|
|
|
2023-12-16 17:48:15 +00:00
|
|
|
signingkey=$(git config user.signingkey)
|
2024-01-02 12:28:33 +00:00
|
|
|
if [[ $signingkey =~ ^(ssh|ecdsa|key::) ]]; then
|
2023-12-16 17:48:15 +00:00
|
|
|
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
|
|
|
|
2016-12-12 15:57:39 +00:00
|
|
|
step "Execute pre-commit auto-hook"
|
|
|
|
git autohook pre-commit
|
|
|
|
|
2016-10-19 15:25:32 +00:00
|
|
|
step "Issuing commit..."
|
2017-11-10 11:44:57 +00:00
|
|
|
COMMIT_OPTS=$(git config --get commit.cliopts 2>/dev/null || echo "")
|
|
|
|
git commit -v ${COMMIT_OPTS} "$@"
|
2016-07-21 13:48:49 +00:00
|
|
|
|
2016-12-12 15:57:39 +00:00
|
|
|
step "Execute post-commit auto-hook"
|
|
|
|
git autohook post-commit
|