{"thread":{"id":"13260","subject":"[PATCH] Check for circular references causing 'lost' nodes","startedAt":"2008-04-03T08:48:38Z","lastAt":"2008-04-26T14:41:53Z","messageCount":2,"participants":["Stephen R. van den Berg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"75201","messageId":"20080425234556.C271E545D@aristoteles.cuci.nl","threadId":"13260","inReplyTo":null,"subject":"[PATCH] Check for circular references causing 'lost' nodes","fromName":"Stephen R. van den Berg","fromEmail":"srb@cuci.nl","sentAt":"2008-04-03T08:48:38Z","receivedAt":"2008-04-03T08:48:38Z","isPatch":true,"sender":{"key":"srb@cuci.nl","avatar":"https://gravatar.com/avatar/f75389059e827634d38e9df2a9b6ecbd50028b5a454442efa1c7205b7ff29c6a?d=mp&s=160"},"body":"---\n commit.c |    6 ++++++\n 1 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/commit.c b/commit.c\nindex 94d5b3d..7524d2b 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -426,6 +426,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)\n \tstruct commit_list *next, *orig = *list;\n \tstruct commit_list *work, **insert;\n \tstruct commit_list **pptr;\n+\tint nelements = 0;\n \n \tif (!orig)\n \t\treturn;\n@@ -436,6 +437,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)\n \t\tstruct commit *commit = next->item;\n \t\tcommit->object.flags |= TOPOSORT;\n \t\tcommit->indegree = 0;\n+\t\tnelements++;\n \t}\n \n \t/* update the indegree */\n@@ -506,7 +508,11 @@ void sort_in_topological_order(struct commit_list ** list, int lifo)\n \t\tcommit->object.flags &= ~TOPOSORT;\n \t\t*pptr = work_item;\n \t\tpptr = &work_item->next;\n+\t\tnelements--;\n \t}\n+\tif (nelements)\n+\t\tfprintf(stderr, \"Circular references in %d suppressed nodes\\n\",\n+\t\t nelements);\n }\n \n /* merge-base stuff */\n-- \n1.5.5.1.83.ge77a4.dirty\n"},{"id":"75223","messageId":"20080426144153.GA21197@cuci.nl","threadId":"13260","inReplyTo":"20080425234556.C271E545D@aristoteles.cuci.nl","subject":"Re: [PATCH] Check for circular references causing 'lost' nodes","fromName":"Stephen R. van den Berg","fromEmail":"srb@cuci.nl","sentAt":"2008-04-26T14:41:53Z","receivedAt":"2008-04-26T14:41:53Z","isPatch":true,"sender":{"key":"srb@cuci.nl","avatar":"https://gravatar.com/avatar/f75389059e827634d38e9df2a9b6ecbd50028b5a454442efa1c7205b7ff29c6a?d=mp&s=160"},"body":"The most likely cause for circular references are bad entries in the\ngrafts file (like I did once); since basically noone tells you where you\nwent wrong, it can be a bit puzzling to find out that part of your tree\ngoes dark sometimes, depending on which tool/options you pick to walk the\ncommit-tree.\n-- \nSincerely,                                                          srb@cuci.nl\n           Stephen R. van den Berg (AKA BuGless).\n\"God gave us a penis and a brain but not enough blood\n to use both at the same time.\" -- Robin Williams\n"}]}