(I would post after, but Outlook is being a pain.)
I don’t understand what you are saying. Perhaps there’s one point I made that is not completely clear. This hook is working perfectly fine in recent versions of Eclipse on Windows. That means it is working with JGit on Windows. What is
not working is doing the same thing in Anypoint studio on Windows, which uses that old version of Egit.
From: Matthias Sohn <matthias.sohn@xxxxxxxxx>
Sent: Friday, February 7, 2025 11:08 AM
To: EGit developer discussion <egit-dev@xxxxxxxxxxx>
Cc: KARR, DAVID <dk068x@xxxxxxx>
Subject: Re: [egit-dev] Investigating an issue with git hooks in egit version 6.5.0.202303070854-r
On Fri, Feb 7, 2025 at 6: 41 PM
KARR, DAVID via egit-dev <egit-dev@ eclipse. org>
wrote: 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'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 :-)
|