From 1f53285f6422fcf1b2228ecd25ebb541b999b048 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sun, 10 Jan 2021 19:21:33 -0800 Subject: [PATCH] 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). --- src/commands.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands.rs b/src/commands.rs index effd05286..c12375603 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -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,