hooks/pre-push: Make the hook a bit more clever

Relax the conditions that lead to the commits being pushed to be checked
for Change-Id and Story-Id. The check is actually taking place now only
if there is some other commit with the relevant tag that is an ancestor
of the commit being checked.

This change is introduced to make it possible to start using SalsaFlow
on older projects where the tags are missing and it's not possible to
fix it really.

[ci skip]

Change-Id: eba241960e