def validate_hook(shell_cmd, hook_name):
 if shell_cmd:
  cmd = shell_cmd.split(None, 1)[0]
  if (not _prog(cmd)):
   path = os.environ['PATH']
   msg = 'Unable to find {2}-hook command {0} in the PATH.\n(PATH is {1})'.format(cmd, path, hook_name)
   raise errors.HookCommandNotFound(msg)

def validate_hook ( shell_cmd , hook_name ) : if shell_cmd : cmd = shell_cmd . split ( None , 1 ) [ 0 ] if ( not _prog ( cmd ) ) : path = os . environ [ 'PATH' ] msg = 'Unable to find {2}-hook command {0} in the PATH.\n(PATH is {1})' . format ( cmd , path , hook_name ) raise errors . HookCommandNotFound ( msg )
check that a command provided as a hook is plausibly executable .