Hi Martin,

I can confirm your issue. This seems to be an msysgit issue:
msysgit (as of version 1.9.5) comes with a bash executable that is compiled 
without support for =~, the regex-matching operator [1]

For now I am going to keep the script as is, considering it is an issue only on 
Windows running msysgit 1.9.5 and later. If that problem is not solved in 
future msysgit versions we might have to change the code.

Best,
Caspar

[1] 
http://stackoverflow.com/questions/28914269/how-can-i-capture-group-from-string-using-regexp-in-shell-in-msysgit-on-windows
 

-----Ursprüngliche Nachricht-----
Von: Martin Klemm [mailto:[email protected]] 
Gesendet: Freitag, 14. August 2015 16:15
An: [email protected]
Betreff: [mitk-users] Precommit hook returning error

Hi everyone,

I just downloaded the pre-commit hook from your webpage 
http://www.mitk.org/wiki/File:Pre-commit.sample

To test it I added a whitespace and deleted the eof. Both were detected.
Then I fixed them and tried to commit the changes but received the following 
errors from the hook:

d:/Projects/MITK_GH_OIGTL/.git/hooks/pre-commit: line 209: conditional binary 
operator expected
d:/Projects/MITK_GH_OIGTL/.git/hooks/pre-commit: line 209: syntax error near 
`=~'
d:/Projects/MITK_GH_OIGTL/.git/hooks/pre-commit: line 209: `      [[
${array[0]} =~ $path_regex ]] ||  echo "No valid image path, received :
${array[0]}"'

Does anybody know how to fix this in a proper way? Anyone else experienced this 
error? At the moment I fixed it by commenting it out.
Therefore the function check_new_doxygen_image_tag_syntax is not doing its job 
properly...

Best

Martin

------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to