eclipse-jgit / jgit

JGit, the Java implementation of git
https://www.eclipse.org/jgit/
Other
163 stars 48 forks source link

Missing support of Git Hook prepare-commit-msg #71

Open remybcnes opened 4 months ago

remybcnes commented 4 months ago

Version

6.10

Operating System

Linux/Unix, MacOS, Windows

Bug description

Git hook prepare-commit-msg is officially defined and implemented since Git v2.32.0 (at least) : https://www.git-scm.com/docs/githooks/2.32.0

However, JGit does not support it, hence not being compliant with Git 2.32+.

Actual behavior

JGit does not support all Githooks, hence not being compliant with Git 2.32+. It is limited to the ones defined in https://github.com/eclipse-jgit/jgit/tree/stable-6.10/org.eclipse.jgit/src/org/eclipse/jgit/hooks

Expected behavior

Support of all client-side Githooks defined in https://www.git-scm.com/docs/githooks/

In particular, a mechanism allowing for commit messages preparation should be proposed.

Relevant log output

No response

Other information

No response

ciscoo commented 1 month ago

I think this issue should be more of an umbrella issue retitled to missing several githooks.

We use owasp/sedated which is a pre-receive hook. It is a bit of a pain to figure out what is being blocked when the only log is:

[DEBUG] [org.eclipse.jgit.transport.PacketLineIn] git< unpack ok
[DEBUG] [org.eclipse.jgit.transport.PacketLineIn] git< ng refs/heads/gh-pages pre-receive hook declined
[DEBUG] [org.eclipse.jgit.transport.PacketLineIn] git< 0000