Updated the hook so that it works on UNIX, also removed the $messages array since it delayed output with big commits.