On Wed, 7 Dec 2016 17:34:27 +0530
Mrudula Varimadugu <[email protected]> wrote:

> Still not working.
> I tried by keeping die("Kaboom!\n"); in the pre-receive file.
> but still it pushed my commit, it didn't fail.
> see the output below when I tried individually ./pre-receive it
> printed Kaboom and it came out, but when I try to push it didnt.
> 
> $ ./pre-receive
> Kaboom!
[...]
> $ git add gitHooks/pre-receive
> $ git commit -m "hook test"
> $ git push origin feature/DD-157-pre-recieve-hook-to-force-jira-ticket
[...]

I'm not sure I follow.
What's the point of committing a hook file and then pushing it out?

Hooks are enabled in the remote repository -- that one which receives
the push.  Enabling a hook amounts of linking/creating a file with the
name matching that of the hook under a special directory in the
repository's "Git directory"; let's cite the entry section from the
"githooks" manual page:

|   Hooks are little scripts you can place in $GIT_DIR/hooks
| directory to trigger action at certain points. When git init is run,
| a handful of example hooks are copied into the hooks directory of the
| new repository, but by default they are all disabled. To enable a
| hook, rename it by removing its .sample suffix.
|
|   Note It is also a requirement for a given hook to be executable.
| However - in a freshly initialized repository - the .sample files are
| executable by default.

Are you sure you do with your hook what's written there?
Do you understand how hooks work?

[...]

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to