You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need JGit to support git hooks on Windows that are exe files. Apparently hooks on Windows can only work in contrived situations, supposedly because the name of the file has to be exactly "commit-msg", but the name of the file will be "commit-msg.exe".
Motivation
I implemented a local git commit hook to validate commit messages, to ensure they cite a valid JIRA ticket. We are moving all of our git storage from BitBucket to Github. BitBucket has a server-side "pre-receive" hook for pushes that can be used to do this validation, but nothing like that exists for Github (Github Actions will not suffice). What I implemented works fine with command-line git, but then I discovered that it has no effect in Eclipse, and after filing an EGit ticket (eclipse-egit/egit#74), I realized that this is an issue in JGit, not EGit.
If we can't do client-side validation, we'll have to rely on a poorer choice of validating commits in builds, and if those find violations, will mean harder work for developers.
Alternatives considered
I did try storing an additional file in the hooks directory, called just "commit-msg" (empty file), thinking perhaps that would fool it, but that had no effect.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Only indirectly by invoking your exe files from a bash script.
You can use hooks in Eclipse by doing the following.
Make sure jgit recognizes that it can run hooks. The easiest way for me was the following
Put C:\Program Files\Git\bin on your PATH if it is not already
Create an empty file C:\Program Files\Git\bin\cygpath.exe
This is needed to "trick" jgit to detect that it can run sh.exe and therefore hook scripts
That file must just be on the path. It is then not really used at all.
Now edit your commit-msg hook script and invoke your own commands in it. You need to write it as a valid shell script
You may need to put your own exe files into C:\Program Files\Git\mingw64\bin
Description
I need JGit to support git hooks on Windows that are exe files. Apparently hooks on Windows can only work in contrived situations, supposedly because the name of the file has to be exactly "commit-msg", but the name of the file will be "commit-msg.exe".
Motivation
I implemented a local git commit hook to validate commit messages, to ensure they cite a valid JIRA ticket. We are moving all of our git storage from BitBucket to Github. BitBucket has a server-side "pre-receive" hook for pushes that can be used to do this validation, but nothing like that exists for Github (Github Actions will not suffice). What I implemented works fine with command-line git, but then I discovered that it has no effect in Eclipse, and after filing an EGit ticket (eclipse-egit/egit#74), I realized that this is an issue in JGit, not EGit.
If we can't do client-side validation, we'll have to rely on a poorer choice of validating commits in builds, and if those find violations, will mean harder work for developers.
Alternatives considered
I did try storing an additional file in the hooks directory, called just "commit-msg" (empty file), thinking perhaps that would fool it, but that had no effect.
Additional context
No response
The text was updated successfully, but these errors were encountered: