Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » EGit circumvents remote pre-receive hooks?
EGit circumvents remote pre-receive hooks? [message #1725350] Wed, 02 March 2016 21:52 Go to next message
Joe Joeseph is currently offline Joe JoesephFriend
Messages: 5
Registered: July 2014
Junior Member
I set up a simple test repo and created a pre-receive git hook which checks for a specific commit message format.

I then cloned this test repo, made a modification and performed a local commit with an invalid commit message format.

Next, I attempted to push this commit to the remote repo using git push. It failed as expected because of the pre-receive hook.

Finally, I used the EGit features (add existing repo, import general project from the working directory) in Eclipse and attempted to push from there using one of the toolbar buttons. Unexpectedly the commit went through, despite definitely having an invalid commit message format.

So did Eclipse/EGit somehow circumvent my remote repository pre-recieve hook? How is that possible?
Re: EGit circumvents remote pre-receive hooks? [message #1725351 is a reply to message #1725350] Wed, 02 March 2016 21:58 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1180
Registered: July 2009
Senior Member
Hooks support in JGit is still incomplete, EGit 4.2 supports the following hooks
- pre-commit
- commit-msg
- pre-push
Re: EGit circumvents remote pre-receive hooks? [message #1725370 is a reply to message #1725351] Thu, 03 March 2016 06:00 Go to previous message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 274
Registered: July 2009
Senior Member
I think Joe describes a different scenario where it is not about which hooks egit/jgit supports. If I understood correctly then there exists a non jgit/egit server which has a pre-receive hook. When pushing with native git to the server the server executes that hook and denies the push. But when pushing from EGit that same server accepts the hook. Somehow the git client which is used controls whether the server executes the hook or not. Is my understanding correct?

Previous Topic:Are the files physically stored on your local drive when you clone a repository?
Next Topic:Temporarily hide untracked files in Synchronize and Git Staging Views
Goto Forum:

Current Time: Sun Jul 25 16:26:47 GMT 2021

Powered by FUDForum. Page generated in 0.01989 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top