trap EXIT is just too brittle, use plain || die Suggested-by: geirha on #bash IRC channel
Also, GIT_OBS_HOOKS_DEBUG was meant to be initialized with a default value 0, if nothing is set, not expanded with substring from position 0, right?
This is just copying what user expects from the similar runners in the system. User needs to have an option to temporarily disable some scripts for testing or debugging purposes.