git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Check for circular references causing 'lost' nodes
@ 2008-04-03  8:48 Stephen R. van den Berg
  2008-04-26 14:41 ` Stephen R. van den Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen R. van den Berg @ 2008-04-03  8:48 UTC (permalink / raw)
  To: git

---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Check for circular references causing 'lost' nodes
  2008-04-03  8:48 [PATCH] Check for circular references causing 'lost' nodes Stephen R. van den Berg
@ 2008-04-26 14:41 ` Stephen R. van den Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen R. van den Berg @ 2008-04-26 14:41 UTC (permalink / raw)
  To: git

The most likely cause for circular references are bad entries in the
grafts file (like I did once); since basically noone tells you where you
went wrong, it can be a bit puzzling to find out that part of your tree
goes dark sometimes, depending on which tool/options you pick to walk the
commit-tree.
-- 
Sincerely,                                                          srb@cuci.nl
           Stephen R. van den Berg (AKA BuGless).
"God gave us a penis and a brain but not enough blood
 to use both at the same time." -- Robin Williams

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-26 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-03  8:48 [PATCH] Check for circular references causing 'lost' nodes Stephen R. van den Berg
2008-04-26 14:41 ` Stephen R. van den Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).