[RFC PATCH v2 08/13] walken: demonstrate various topographical sorts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <emilyshaffer@xxxxxxxxxx>
Change-Id: I7ce2f3e8a77c42001293637ae209087afec4ce2c
---
 builtin/walken.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/builtin/walken.c b/builtin/walken.c
index da2d197914..6cc451324a 100644
--- a/builtin/walken.c
+++ b/builtin/walken.c
@@ -69,6 +69,13 @@ 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;
+
+	/* Toggle between these and observe the difference. */
+	rev->sort_order = REV_SORT_BY_COMMIT_DATE;
+	/* rev->sort_order = REV_SORT_BY_AUTHOR_DATE; */
 }
 
 /*
-- 
2.22.0.410.gd8fdbe21b5-goog




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux