[log] Fail safer if no refs were found at some head commit

Returning a NullVirtualFile won't help, because it just fails later
in the DataGetter in attempt to load commit details from the VCS.

Returning the first root is better: it will suit in most cases
(one-repo case), although it can easily fail in multi-repo case.
(cherry picked from commit 09f5029)
[log] Don't report the error too often

(cherry picked from commit 95468ea05158b7b072e8e1b16023ffb745300d6e)
[git] Don't log error in case of empty config file - it is allowed

(cherry picked from commit 172a3f9675076d4a89f566e27a922dfa31c2a0be)
[git] IDEA-124052 Support remote refs w/o a correspondent remote + test

(cherry picked from commit 899e7e3, test is not added due to significant
difference in the test framework in master & 135)
[log] Fix transitivity in compareTo

Relates to IDEA-124416

(cherry picked from commit 27a2e0f8520f4ac2d070f68a35e68adff03a4b85)