Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JGit on Windows cannot use hooks that are exe files #128

Open
davidmichaelkarr opened this issue Jan 10, 2025 · 0 comments
Open

JGit on Windows cannot use hooks that are exe files #128

davidmichaelkarr opened this issue Jan 10, 2025 · 0 comments

Comments

@davidmichaelkarr
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant