install.fairie/.local/share/git-core/templates/hooks/post-commit

10 lines
374 B
Text
Raw Normal View History

2022-11-29 22:26:34 -08:00
#!/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) ###