#!/bin/bash -e

set -o pipefail
set -e

source "${HOME}/bin/script_framework.sh"

### Fix committer email by repo

step "Ensure correct committer email..."
git setmail

### Commit

step "Loading passphrase for GPG key..."
vault-gpg $(git config user.signingkey)

step "Execute pre-commit auto-hook"
git autohook pre-commit

step "Issuing commit..."
git commit -S -s -v "$@"

step "Execute post-commit auto-hook"
git autohook post-commit