From: Stephen R. van den Berg Date: Thu, 03 Apr 2008 08:48:38 GMT Subject: [PATCH] Check for circular references causing 'lost' nodes Message-ID: <20080425234556.C271E545D@aristoteles.cuci.nl> --- commit.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/commit.c b/commit.c index 94d5b3d..7524d2b 100644 --- a/commit.c +++ b/commit.c @@ -426,6 +426,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo) struct commit_list *next, *orig = *list; struct commit_list *work, **insert; struct commit_list **pptr; + int nelements = 0; if (!orig) return; @@ -436,6 +437,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo) struct commit *commit = next->item; commit->object.flags |= TOPOSORT; commit->indegree = 0; + nelements++; } /* update the indegree */ @@ -506,7 +508,11 @@ void sort_in_topological_order(struct commit_list ** list, int lifo) commit->object.flags &= ~TOPOSORT; *pptr = work_item; pptr = &work_item->next; + nelements--; } + if (nelements) + fprintf(stderr, "Circular references in %d suppressed nodes\n", + nelements); } /* merge-base stuff */ -- 1.5.5.1.83.ge77a4.dirty