logmsg-git-hook: fix commit determination logic & run on new MW branch creation

Change-Id: I30f4e59752cc24381aeef9f0702ad6252223d953