write-ups-challenges-2024-2025/flagisnowhidden/conf/html/git/hooks/post-commit

9 lines
373 B
Plaintext
Raw Permalink Normal View History

2024-11-25 21:29:38 +00: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) ###