{"thread":{"id":"1152","subject":"[PATCH] Move SEEN flag into epoch.h, replace use of VISITED flag with SEEN flag","startedAt":"2005-07-07T02:11:20Z","lastAt":"2005-07-07T02:11:20Z","messageCount":1,"participants":["Jon Seymour"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"5747","messageId":"20050707021120.20027.qmail@blackcubes.dyndns.org","threadId":"1152","inReplyTo":null,"subject":"[PATCH] Move SEEN flag into epoch.h, replace use of VISITED flag with SEEN flag","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2005-07-07T02:11:20Z","receivedAt":"2005-07-07T02:11:20Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"\nSEEN and VISITED do the same thing.\n\nThis change moves the SEEN flag into epoch.h, then replaces\nuses of VISITED with SEEN and removes the definition\nof the VISITED flag.\n\nThe merge-order code needs to clear the SEEN flag\nset by the argument parsing to ensure correct\noperation. So it clears that one and, for completeness,\nBOUNDARY and DISCONTINUITY too.\n\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\n\n epoch.c    |   14 ++++++++------\n epoch.h    |    4 +---\n rev-list.c |    5 ++---\n 3 files changed, 11 insertions(+), 12 deletions(-)\n\n54a391ba7e4f96ce08ecb7da82941519b8a14c30\ndiff --git a/epoch.c b/epoch.c\n--- a/epoch.c\n+++ b/epoch.c\n@@ -387,7 +387,7 @@ static void push_onto_merge_order_stack(\n static void mark_ancestors_uninteresting(struct commit *commit)\n {\n \tunsigned int flags = commit->object.flags;\n-\tint visited = flags & VISITED;\n+\tint visited = flags & SEEN;\n \tint boundary = flags & BOUNDARY;\n \tint uninteresting = flags & UNINTERESTING;\n \tstruct commit_list *next;\n@@ -425,7 +425,7 @@ static void sort_first_epoch(struct comm\n {\n \tstruct commit_list *parents;\n \n-\thead->object.flags |= VISITED;\n+\thead->object.flags |= SEEN;\n \n \t/*\n \t * TODO: By sorting the parents in a different order, we can alter the\n@@ -450,14 +450,14 @@ static void sort_first_epoch(struct comm\n \t\t\tmark_ancestors_uninteresting(parent);\n \t\t}\n \n-\t\tif (!(parent->object.flags & VISITED)) {\n+\t\tif (!(parent->object.flags & SEEN)) {\n \t\t\tif (parent->object.flags & BOUNDARY) {\n \t\t\t\tif (*stack) {\n \t\t\t\t\tdie(\"something else is on the stack - %s\",\n \t\t\t\t\t    sha1_to_hex((*stack)->item->object.sha1));\n \t\t\t\t}\n \t\t\t\tpush_onto_merge_order_stack(stack, parent);\n-\t\t\t\tparent->object.flags |= VISITED;\n+\t\t\t\tparent->object.flags |= SEEN;\n \n \t\t\t} else {\n \t\t\t\tsort_first_epoch(parent, stack);\n@@ -582,8 +582,10 @@ int sort_list_in_merge_order(struct comm\n \tint action = CONTINUE;\n \tstruct commit_list *reversed = NULL;\n \n-\tfor (; list; list = list->next)\n+\tfor (; list; list = list->next) {\n+\t\tlist->item->object.flags &= ~(SEEN|BOUNDARY|DISCONTINUITY);\n \t\tcommit_list_insert(list->item, &reversed);\n+\t}\n \n \tif (!reversed)\n \t\treturn ret;\n@@ -606,7 +608,7 @@ int sort_list_in_merge_order(struct comm\n \t\twhile (reversed) {\n \t\t\tstruct commit * next = pop_commit(&reversed);\n \n-\t\t\tif (!(next->object.flags & VISITED) && next!=base) {\n+\t\t\tif (!(next->object.flags & SEEN) && next!=base) {\n \t\t\t\tsort_first_epoch(next, &stack);\n \t\t\t\tif (reversed) {\n \t\t\t\t\t/*\ndiff --git a/epoch.h b/epoch.h\n--- a/epoch.h\n+++ b/epoch.h\n@@ -13,9 +13,7 @@ int sort_list_in_merge_order(struct comm\n /* Low bits are used by rev-list */\n #define UNINTERESTING   (1u<<10)\n #define BOUNDARY        (1u<<11)\n-#define VISITED         (1u<<12)\n+#define SEEN            (1u<<12)\n #define DISCONTINUITY   (1u<<13)\n-#define LAST_EPOCH_FLAG (1u<<14)\n-\n \n #endif\t/* EPOCH_H */\ndiff --git a/rev-list.c b/rev-list.c\n--- a/rev-list.c\n+++ b/rev-list.c\n@@ -5,9 +5,8 @@\n #include \"blob.h\"\n #include \"epoch.h\"\n \n-#define SEEN\t\t(1u << 0)\n-#define INTERESTING\t(1u << 1)\n-#define COUNTED\t\t(1u << 2)\n+#define INTERESTING\t(1u << 0)\n+#define COUNTED\t\t(1u << 1)\n \n static const char rev_list_usage[] =\n \t\"usage: git-rev-list [OPTION] commit-id <commit-id>\\n\"\n------------\n"}]}