On Mon, 8 Jul 2013 08:49:15 -0700 (PDT)
mkjkec2...@gmail.com wrote:

>   i am trying to write a pre-push git hook to check the validity of a
> JIRA issue in perl . pre-push perl script executes fine and i get a
> desired output
> when the perl script is  executed through the windows command
> prompt . However , executing git command " git push origin master" to
> invoke the pre-push hook results in an error " illegal division by
> zero in warnings.pm" . Any clue on the behavioral difference when the
> script is executed 
> via windows command prompt versus when invoked by GIT push command .

Supposedly, when a hook script is executed by Git, it's being run using
a port of a POSIX shell, bash, and not Windows shell (cmd.exe) -- hence
I imagine there might be behavioral differences:
* Different environment.
* Git comes with its of minimal Perl installation, so if you have
  another one installed (like ActiveState Perl or Strawberry Perl etc),
  the latter might be picked when you perform your trial runs while
  the former is used by Git when running your hook.
* Push hooks run with the same credentials Git process serving the push
  operation is using; these might well be different from those you're
  logged in with while developing.

Where to go from there -- try to re-create as close an environment to
that seen by your hook when it's being spawned by Git:
* Do your trial runs using Perl which comes with Git itself
* Do that in that "Git bash" window (accessible via the Git's Windows
  Start Menu entry) rather than in cmd.exe.
* Run Git bash with the same credentials used by your Git server
  process.  If it runs with the LOCAL SYSTEM credentials, one trick to
  get the shell with appropriate credentials is to run
  `psexec -s ...` (available as part of the Sysinternals package).

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 git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to