This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 238365

Summary: git hooks on remote archive won't run
Product: versioncontrol Reporter: c.muehlmann
Component: GitAssignee: Ondrej Vrabec <ovrabec>
Status: NEW ---    
Severity: normal CC: git
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:

Description c.muehlmann 2013-11-14 11:29:13 UTC
Hello,

I'm developing a website, and I'm using git for versioncontrol. There are local archives on differend desktop-PC's and one bare archive on one of them. This  bare archive has one hook activated (post-receive), to checkout a copy to the directory of the webserver. 

While this works fine using git gui (commit and push to bare archive), the hook won't run when using git from netbeans. 
As described in https://netbeans.org/bugzilla/show_bug.cgi?id=211451 jgit won't run local hooks (because it's an pure java implementation). 
But is this statement also valid for remote hooks when pushing to a remote archive?

Christoph
Comment 1 Ondrej Vrabec 2013-11-14 16:17:00 UTC
do you push over http(s)? Or ssh?
Comment 2 c.muehlmann 2013-11-14 18:56:50 UTC
when i'm using ssh there's no problem. 

but if I'm using an local file:/home/user/git/bare.git path (in one case, my working repo and the bare repo are on the same mashine) the hook is not executed.

Christoph
Comment 3 Ondrej Vrabec 2013-11-14 19:21:00 UTC
thanks. The same reason as in bug #211451. JGit does not handle hooks itself. Needs to be implemented in JGit.
Comment 4 c.muehlmann 2013-11-14 19:33:50 UTC
would it be an idea, if either someone uses a file:/-path or if valid hook-files are detected locally in .git/hooks, to display a warning that jgit doesn't handle hooks?
Comment 5 Ondrej Vrabec 2013-11-14 19:44:28 UTC
sure, we could do it. Although i'm not sure if it'd be reliable, could we show a potential false alarm? When .git/hooks is not empty but still does not contain any after-push-hook?
Comment 6 c.muehlmann 2013-11-14 20:15:37 UTC
If I understood it right, there are no hooks which are going to be executed at any time. This seems to be valid not only for after-push hooks, but for all available hooks.

So if there are hook files inside (except *.sample), a warning that existing hook-files won't be handled with file:// could be helpful.

Using ssh on localhost could be an alternative, when hooks are necessary on an bare repo on thee local filesystem (in my case I could use ssh://localhost/home/user/git/bare.git instead of file:/home/user/git/bare.git)