[RFC PATCH 09/13] walken: demonstrate reversing a revision walk list
- From
Emily Shaffer <emilyshaffer@google.com>
- Date
- Jun 7, 2019, 01:08 UTC
- Message-ID
- <20190607010811.52944-10-emilyshaffer@google.com>
- In-Reply-To
- <20190607010811.52944-1-emilyshaffer@google.com>
The final installment in the tutorial about sorting revision walk outputs. This commit reverses the commit list, so that we see newer commits last (handy since we aren't using a pager).
It's important to note that rev->reverse needs to be set after add_head_to_pending() or before setup_revisions(). (This is mentioned in the accompanying tutorial.)
Signed-off-by: Emily Shaffer <emilyshaffer@google.com> --- builtin/walken.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/builtin/walken.c b/builtin/walken.c index 716d31f04e..86c8d29c48 100644 --- a/builtin/walken.c +++ b/builtin/walken.c @@ -61,6 +61,9 @@ static void final_rev_info_setup(int argc, const char **argv, const char *prefix /* add the HEAD to pending so we can start */ add_head_to_pending(rev); + + /* Reverse the order */ + rev->reverse = 1; /* Let's play with the sort order. */ rev->topo_order = 1;
-- 2.22.0.rc1.311.g5d7573a151-goog