Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » GIT Hooks(Why don't my GIT Hooks work?)
GIT Hooks [message #976490] Thu, 08 November 2012 16:15 Go to next message
Dan Hargreaves is currently offline Dan HargreavesFriend
Messages: 7
Registered: November 2010
Junior Member
So I'm investigating moving some of our version control to GIT and am having some trouble with the hooks. We maintain a database of currently open tasks and developers must commit changes against those. Consequently we currently have CVS hooks to verify that a commit is being made against a valid task.

I have a GIT repo and have tried adding some hooks into it, commit-msg hook on the local machine and a post-receive hook on the main server but am having trouble getting these to execute. In fact the only way I can get the local hook to execute is by committing a change via the command line, without changing anything but committing through eclipse the hook does not get executed.

After some googling I've found a couple of posts particularly stackoverflow.com/questions/6232026/egit-hooks-do-not-get-triggered which suggests that using EGit I won't get any hooks executed. This post is fairly old but I can't see anything official so I'm not sure whether there is a problem with my setup or if hooks really don't get executed?

If they don't - how come? What is EGit doing that stops GIT from executing the hook as per usual?

Thanks for your help!

Dan.
Re: GIT Hooks [message #976673 is a reply to message #976490] Thu, 08 November 2012 19:11 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Dan Hargreaves skrev 2012-11-08 17.15:
> After some googling I've found a couple of posts particularly stackoverflow.com/questions/6232026/egit-hooks-do-not-get-triggered which suggests that using EGit I won't get
> any hooks executed. This post is fairly old but I can't see anything official so I'm not sure whether there is a problem with my setup or if hooks really don't get
executed?
>
> If they don't - how come? What is EGit doing that stops GIT from executing the hook as per usual?

It's mostly a matter of priorities. There are so many other things to do first. As always, patches welcome.
Consider that we do not require, and will not require, Git to be installed so hook execution would be optional.

-- robin
Re: GIT Hooks [message #977386 is a reply to message #976673] Fri, 09 November 2012 08:42 Go to previous messageGo to next message
Dan Hargreaves is currently offline Dan HargreavesFriend
Messages: 7
Registered: November 2010
Junior Member
Ok, thanks. Its maybe something that I've overlooked then - I assumed EGit simply wrapped around GIT providing a java library rather than resorting to the command line - but if it doesn't require GIT to be installed is it then actually a reimplementation of GIT in java?

Thanks.
Re: GIT Hooks [message #977833 is a reply to message #977386] Fri, 09 November 2012 16:08 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 701
Registered: July 2009
Senior Member
Le 09/11/2012 09:42, Dan Hargreaves a écrit :
> Ok, thanks. Its maybe something that I've overlooked then - I assumed
> EGit simply wrapped around GIT providing a java library rather than
> resorting to the command line - but if it doesn't require GIT to be
> installed is it then actually a reimplementation of GIT in java?

JGit is a reimplementation of Git in pure Java (and under a license more
compatible with Eclipse): http://eclipse.org/jgit/

EGit is the integration of JGit in the Eclipse UI and Team APIs:
http://eclipse.org/egit/


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: GIT Hooks [message #979155 is a reply to message #977833] Sat, 10 November 2012 17:25 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
Getting back to the original question, JGIt is not a complete implementation of Git. One of the features it does not yet support is hooks, at least as far as I know.

There are a number of other missing features. Here's a list of the ones I've run into:


Commonly used operations that are not supported:

- svn

- bundle

- prune [maybe this works as part of the new 'Collect Garbage' operation]

- checkout <commit> -- <directory>

- reset <commit> -- <path>
except for the special case of resetting a single file to the HEAD revision
which can be done by unstaging workspace changes to that file.


Commonly used features that are not supported:

- Pulling from a bundle

- Hooks

- Creation of light-weight and signed tags

- Most merge options, including -s, -ff, -no-ff, -ff-only. One that is supported as of 2.1 is '--squash'.

- Merge strategies other than'resolve'. Since the
default strategy in command-line Git is 'recursive'in the
most common cases (pulling, or merging one branch) you might
get different behavior from an egit merge or pull.

- Most rebase options other than --skip, --continue and --abort.

- A number of configuration settings, including most of the
ones related to merging,

[Updated on: Sun, 11 November 2012 15:41]

Report message to a moderator

Re: GIT Hooks [message #982207 is a reply to message #977386] Tue, 13 November 2012 01:35 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Dan Hargreaves skrev 2012-11-09 09.42:
> Ok, thanks. Its maybe something that I've overlooked then - I assumed EGit simply wrapped around GIT providing a java library rather than resorting to the command line -
> but if it doesn't require GIT to be installed is it then actually a reimplementation of GIT in java?

Indeed it it.

-- robin
Re: GIT Hooks [message #985802 is a reply to message #979155] Fri, 16 November 2012 08:47 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
R Shapiro wrote on Sat, 10 November 2012 12:25
Getting back to the original question, JGIt is not a complete implementation of Git. One of the features it does not yet support is hooks, at least as far as I know.

There are a number of other missing features. Here's a list of the ones I've run into:


Commonly used operations that are not supported:

- svn

- bundle

- prune [maybe this works as part of the new 'Collect Garbage' operation]

- checkout <commit> -- <directory>

- reset <commit> -- <path>
except for the special case of resetting a single file to the HEAD revision
which can be done by unstaging workspace changes to that file.


Commonly used features that are not supported:

- Pulling from a bundle

- Hooks

- Creation of light-weight and signed tags


Use of Bouncycastle was approved in the meantime, we are still struggling to get this into Orbit [1], as soon as this is available I can continue my work on [2].

Quote:

- Most merge options, including -s, -ff, -no-ff, -ff-only. One that is supported as of 2.1 is '--squash'.


Tomasz is working on --no-ff [3]

Quote:

- Merge strategies other than'resolve'. Since the
default strategy in command-line Git is 'recursive'in the
most common cases (pulling, or merging one branch) you might
get different behavior from an egit merge or pull.


George is working on an implementation for recursive merge [4]

Quote:

- Most rebase options other than --skip, --continue and --abort.

- A number of configuration settings, including most of the
ones related to merging,


[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=391302
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=386908
[3] https://git.eclipse.org/r/#/c/8395/
[4] https://git.eclipse.org/r/#/c/8113/
Previous Topic:Reduce walk memory usage
Next Topic:pull from another remote/branch
Goto Forum:
  


Current Time: Tue Mar 19 04:41:48 GMT 2024

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

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

Back to the top