install.fairie/.local/share/git-core/templates/hooks/post-commit
Brian Zalewski 0927bd690e Latest
2022-11-30 01:26:59 -05:00

9 lines
374 B
Bash

#!/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) ###