Order the revision walk by author or commit dates, to demonstrate how to
apply topo_sort to a revision walk.

While following the tutorial, new contributors are guided to run a walk
with each sort and compare the results.

Signed-off-by: Emily Shaffer <emilyshaf...@google.com>
---
 builtin/walken.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/builtin/walken.c b/builtin/walken.c
index 6c0f4e7b7a..716d31f04e 100644
--- a/builtin/walken.c
+++ b/builtin/walken.c
@@ -61,6 +61,11 @@ 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);
+       
+       /* Let's play with the sort order. */
+       rev->topo_order = 1;
+       rev->sort_order = REV_SORT_BY_COMMIT_DATE;
+       /* rev->sort_order = REV_SORT_BY_AUTHOR_DATE; */
 }
 
 /*
-- 
2.22.0.rc1.311.g5d7573a151-goog

Reply via email to