I've been working on a local git hook to perform certain validations. It is working fine with the git command line and with recent versions of Eclipse. I'm working with a user who is using the Mulesoft Anypoint Studio on Windows, which uses older versions of the Eclipse platform. This is using version 6.5.0.202303070854-r of eGit.
My git hook is set up with a tiny bash script in C:\Users\<userid>\.githooks\commit-msg . That one-line script just executes the native application I constructed. The "hooksPath" property is set in the user's .gitconfig file. The application also looks for debug properties in .gitconfig to write to a log file. Again, this is all working fine with git on the command line, including the log file.
When this user tries to create a commit from Anypoint Studio that is invalid according to the code in the git hook, it lets the commit proceed. Nothing appears in the log file for the hook. When he does this from the git command line, it properly blocks it.
We have verified in Preferences in Studio that it thinks the user's git configuration is in the location we expect, and it has all the properties we expect.
Is it possible that this old version of eGit (released almost two years ago) is doing something different to check the user's .gitconfig and executing hooks?
Running the hooks via FS.runHookIfPresent() in JGit is currently only implemented in FS_Posix
This means there is no implementation for Windows yet.
Contributions are welcome :-)
-Matthias