Update dotfiles/.gitconfig, dotfiles/.local/git-templates/hooks/post-commit

This commit is contained in:
Brian Zalewski 2022-11-17 17:06:31 +00:00
parent 71966f69e2
commit ea5d1cc10a
2 changed files with 11 additions and 0 deletions

View file

@ -52,6 +52,8 @@
prompt = false
[credential]
helper = cache --timeout=3600
[init]
templatedir = /Users/bzalewski/.local/git-templates
[interactive]
diffFilter = delta --color-only --features=interactive
[merge]

View file

@ -0,0 +1,9 @@
#!/bin/sh
### git-stats hook (begin) ###
# Copy last commit hash to clipboard on commit
commit_hash=$(git rev-parse HEAD)
repo_url=$(git config --get remote.origin.url)
commit_date=$(git log -1 --format=%cd)
commit_data="\"{ \"date\": \"$commit_date\", \"url\": \"$repo_url\", \"hash\": \"$commit_hash\" }\""
git-stats --record "${commit_data}"
### git-stats hook (end) ###