log: output heads in graph ordered by commit id instead of by hash
It was really annoying that the order kept changing as commits got
rewritten. Also, I prefer to see the latest commits at the top (like
Mercurial does it).
@@ -1036,7 +1036,8 @@ fn cmd_log(
heads = skip_uninteresting_heads(&repo, heads);
};
let mut heads: Vec<_> = heads.into_iter().collect();
- heads.sort();
+ heads.sort_by_key(|commit| commit.committer().timestamp.clone());
+ heads.reverse();
let commits = topo_order_reverse(
heads,
