Отладка git -hooks
Почему $GIT_DIR
не выводится в журнал?
#Content of githookTest.sh
foo=~/tmp/foo
rm -rf $foo
mkdir -p $foo
cd $foo
git init
printf "logger 'foo was committed from:' $GIT_DIR" >> .git/hooks/post-commit
sudo chmod +x .git/hooks/post-commit
touch $foo/bar
git add .
git commit -m "Testmessage"
journalctl -b --grep 'foo was committed from:'
Вывод из верхнего сценария
Initialized empty Git repository in /home/user/tmp/foo/.git/
[master (root-commit) 6c16412] Testmessage
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 bar
-- Logs begin at Sat 2019-06-29 11:02:45 CEST, end at Mon 2020-05-04 09:53:18 CEST. --
May 04 09:53:18 x user[5892]: foo was committed from: