gnustavo / Git-Hooks

Framework for implementing Git (and Gerrit) hooks
http://search.cpan.org/dist/Git-Hooks/
41 stars 17 forks source link

regression: nocarp no longer working since 2.0.1 #39

Closed boudekerk closed 7 years ago

boudekerk commented 7 years ago

After upgrading to 2.x, setting nocarp to 1 has no effect anymore:

remote: 
remote: [Git::Hooks::CheckJira] the JIRA issue(s) (TEST-152) do(es) not match the expression 'key IN (TEST-152) AND project IN ('HELPDESK')'
remote:  at /data/git/repositories/sandbox/bartosz.git/custom_hooks/pre-receive line 4

This worked with the 1.16.0 and doesn't for any version since 2.0.1, including the latest 2.1.3

boudekerk commented 7 years ago

Just to add, it is enabled via the githooks.nocarp option as indicated by the Changelog/documentation.

boudekerk commented 7 years ago

Updated my comment and the title, as I haven't actually tested with 2.0.0

gnustavo commented 7 years ago

Hi. I think I fixed it in v2.1.6 which I just released. Please try it out and let me know if it works for you.

Thank you for the heads up!

boudekerk commented 7 years ago

I think the behaviour is reversed now. We now never get the suffix, regardless of the nocarp setting. Which 'works for me', as I can now deploy it to production, but I guess it's still not the correct behaviour.

gnustavo commented 7 years ago

Hi. It took me a while to be able to get back to this.

As I payed more attention to the issue I realized that the nocarp directive doesn't make sense in GH version 2 because the hooks now don't signal errors by dying but by registering error messages via the error method and returning 0. So, their messages shouldn't have line numbers inserted by Perl in any case.

So, I removed the directive from the documentation and from the code altogether in c6e08f1.

OK?

gnustavo commented 7 years ago

I just released v2.1.7. Please, check it out and tell me if it works for you.

boudekerk commented 7 years ago

Works great. Thank you