mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-11-10 21:27:02 +01:00
16 lines
462 B
Bash
Executable File
16 lines
462 B
Bash
Executable File
#!/bin/sh
|
|
|
|
git config --global init.templatedir '~/.git-templates'
|
|
mkdir -p ~/.git-templates/hooks
|
|
|
|
cat << EOF > ~/.git-templates/hooks/post-commit
|
|
#!/bin/sh
|
|
|
|
# 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"
|
|
EOF
|