Git hook, modify commit files
问题 I'm trying to write git pre-commit hook script, it should write date of commit at the begining of modified files. My problem is that i can't add modified files to previous commit. When i trying invoke git commit again it runs recursive. How i can write script, which append time of modification at the end of modified files? My code: #!/bin/bash files_modified=`git diff-index --name-only HEAD` for f in $files_modified; do if [[ $f == *.groovy ]]; then $line = $(head -1 f) if [[ $line == "/%%*"