I am using Git for the version control system.
We have a requirement to keep the commit message to be added into a new file and place in the parent folder.
eg : if the new file is placed in the /pr/ab/cd/ef/a.java location. A file should be created and placed with the commit message on the folder "ef".
I have tried to use the hooks to serve this purpose, but it is not working.
I had used it in the commit-msg/ pre-commit-msg template like the below.
To List the untracked files -->
git ls-files --others --exclude-standard > D:/temp.txt
if [ -f D:/temp.txt ] ; then
for line in `cat D:/temp.txt`;
do
if [ -f $line ] ; then
cp_path=`dirname $line`
echo `date +%d/%m/%Y:%H:%M`-$1-$line >> ${cp_path}/version1.txt
fi
done
fi
This is working fine when this is created as a shell script using git bash instead of hooks.
I am trying to make this work automatically on adding/commiting any new check-in's using TortoiseGit.
Kindly guide me.