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 195527

Summary: Client Side Hook Scripts
Product: versioncontrol Reporter: nbphpuser <nbphpuser>
Component: CodeAssignee: Ondrej Vrabec <ovrabec>
Status: NEW ---    
Severity: normal CC: jordan314
Priority: P1    
Version: 7.0   
Hardware: PC   
OS: Other   
Issue Type: ENHANCEMENT Exception Reporter:

Description nbphpuser 2011-02-15 19:48:52 UTC
Hello,

please implement invoking client-side pre-commit hooks for files to be commited. Scripts should be invoked with list of files to be commited as an argument.

TortoiseSVN has this useful feature:

http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-settings.html


I'd like to test files for unwanted print_r or var_dump statements in PHP, which
I don't want to have in repository.

Thanks!
Comment 1 Tomas Stupka 2011-02-17 12:38:44 UTC
not sure if we will directly write a support for invoking scripts, but we definitely should make the vcs hook api public to make it possible for third party developers to provide their own hooks
Comment 2 voidr 2011-05-24 13:29:05 UTC
I am using git, git supports hook scripts: http://www.kernel.org/pub/software/scm/git/docs/v1.3.3/hooks.html

But Nebeans bypasses them, with the --no-verify option. It would be good, if Netbeans would just print the output in a window, in case of an error.

I want to write scripts that ensure that I only commit correct code, but currently this only works if I commit from the git tool directly, but not if I commit from Netbeans.
Comment 3 jordan314 2012-06-20 19:50:40 UTC
+1 I would like to have this feature too. I just spent several hours making a git pre-commit script that works fine in the command line, but gets skipped because of the --no-verify option.
Comment 4 Ondrej Vrabec 2012-06-21 07:42:33 UTC
> but gets skipped because of the --no-verify option
not at all. Your client-side hooks are not invoked because we do not use the commandline client but a java implementation called JGit instead. It does not support client hooks.
Comment 5 integer 2012-06-21 08:03:24 UTC
so it isn't netbeans bug but very annoying feature?
Comment 6 Ondrej Vrabec 2012-06-21 08:38:30 UTC
(In reply to comment #5)
> so it isn't netbeans bug but very annoying feature?
definitely not a bug. That's why this is tracked as an enhancement request.
Comment 7 Ninj 2016-04-26 10:19:09 UTC
Hi,

Isn't that a very, very high priority task?

Netbeans is used 99% for code writing.
Most code versioning nowadays use GIT.

That probably means that tens of thousands of people are using Netbeans everyday to develop on a GIT-versionned project.

When coding in an IDE, commit, patches, stashes, etc. are much easier done from the IDE (which is aware of many things that happened).

Using a poor-implemented GIT client, preventing everyone with hook scripts from using the GIT interface, is a big issue to me.

Please, make it a major issue and plan to use the command-line instead, with a fully configurable integration.

Thank you
Comment 8 nikdow 2017-07-30 10:02:27 UTC
+1
I'm using GRUNT to create concatenated and minimised JS and CSS files which I want included in each commit. If I forget to run GRUNT before I commit it breaks the project.
Given NB doesn't support hooks, is there a better way around this?