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 - git hooks on remote archive won't run
Summary: git hooks on remote archive won't run
Status: NEW
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Ondrej Vrabec
Depends on:
Reported: 2013-11-14 11:29 UTC by c.muehlmann
Modified: 2013-11-14 20:15 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description c.muehlmann 2013-11-14 11:29:13 UTC

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 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?

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.

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)