Under certain circumstances, gitCommitByP4Change() can enter an infinite
loop resulting in `git p4 sync` hanging forever.
The problem is that
`git rev-list --bisect <latest> ^<earliest>` can return `<latest>`,
which would result in reinspecting <latest> and potentially an infinite loop.
This can happen when importing just a subset of P4 repository
and/or with explicit "--changesfile" option.
The fix is two-fold:
* detect an infinite loop and die right away
instead of looping forever;
* make sure, `git rev-list --bisect` can't return "latestCommit" again
by excluding it from the rev-list range explicitly.
Signed-off-by: Andrey Mazo <amazo@checkvideo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>