{"thread":{"id":"1089","subject":"[PATCH 1/2] Add --topo-order flag to git-rev-list","startedAt":"2005-07-02T06:09:36Z","lastAt":"2005-07-02T07:56:01Z","messageCount":2,"participants":["Jon Seymour"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"5562","messageId":"20050702060936.13011.qmail@blackcubes.dyndns.org","threadId":"1089","inReplyTo":null,"subject":"[PATCH 1/2] Add --topo-order flag to git-rev-list","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2005-07-02T06:09:36Z","receivedAt":"2005-07-02T06:09:36Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"\nAdded a --topo-order flag to git-rev-list.\n\nWhen this flag is specified, git-rev-list sorts its output\nin topological order. That is:\n\n\ta is reachable from b ==> ord(b) < ord(a)\n\nThis ordering invariant is weaker than the --merge-order invariant\nbut should be sufficient for tools just as gitk that only\nneed the minimum guarantee provided by --topo-order.\n\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\nNote: this patch assumes that my previous patch series that introduces\nsort_in_topological_order() to commit.c has been applied.\n\nA subsequent patch to gitk will make gitk use --topo-order instead\nof --merge-order.\n---\n\n rev-list.c |   16 ++++++++++++----\n 1 files changed, 12 insertions(+), 4 deletions(-)\n\n804e6b585e205ba119a9a43058d69c2ef914dc80\ndiff --git a/rev-list.c b/rev-list.c\n--- a/rev-list.c\n+++ b/rev-list.c\n@@ -32,6 +32,7 @@ static int max_count = -1;\n static enum cmit_fmt commit_format = CMIT_FMT_RAW;\n static int merge_order = 0;\n static int show_breaks = 0;\n+static int topo_order=0;\n static int stop_traversal = 0;\n static int bisect_by_cut_option = 0;\n \n@@ -373,11 +374,15 @@ int main(int argc, char **argv)\n \t\t\tblob_objects = 1;\n \t\t\tcontinue;\n \t\t}\n-\t\tif (!strncmp(arg, \"--merge-order\", 13)) {\n+\t\tif (!strcmp(arg, \"--merge-order\")) {\n \t\t        merge_order = 1;\n \t\t\tcontinue;\n \t\t}\n-\t\tif (!strncmp(arg, \"--show-breaks\", 13)) {\n+\t\tif (!strcmp(arg, \"--topo-order\")) {\n+\t\t        topo_order = 1;\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (!strcmp(arg, \"--show-breaks\")) {\n \t\t\tshow_breaks = 1;\n \t\t\tcontinue;\n \t\t}\n@@ -398,9 +403,12 @@ int main(int argc, char **argv)\n \tif (!merge_order) {\t\t\n \t        if (limited)\n \t\t\tlist = limit_list(list);\n-\t\tif (!bisect_by_cut_option) \n+\t\tif (!bisect_by_cut_option) {\n+\t\t\tif (topo_order) {\n+\t\t\t\tsort_in_topological_order(&list);\n+\t\t\t}\n \t\t\tshow_commit_list(list);\n-\t\telse {\n+\t\t} else {\n \t\t\tsort_in_topological_order(&list);\n \t\t\tshow_commit(bisect_by_cut(list));\n \t\t}\n------------\n"},{"id":"5564","messageId":"2cfc4032050702005656b389e@mail.gmail.com","threadId":"1089","inReplyTo":"20050702060936.13011.qmail@blackcubes.dyndns.org","subject":"Re: [WITHDRAWN PATCH 1/2] Add --topo-order flag to git-rev-list","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2005-07-02T07:56:01Z","receivedAt":"2005-07-02T07:56:01Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"Actually, I need to withdraw this patch.\n\nThe way show_commit_list works defeats the approach I was using to\nperform a topological sort - since show_commit_list does more than\nshow the list, it also performs a chronological sort on the list,\nthereby undoing the topological sort that is attempted.\n\njon.\n"}]}