Re: [PATCH] Continue traversal when rev-list --unpacked finds a packed commit.

Subsystems: the rest

2 messages, 2 authors, 2016-08-11 · open the first message on its own page

Re: [PATCH] Continue traversal when rev-list --unpacked finds a packed commit.

From: Junio C Hamano <hidden>
Date: 2016-08-11 20:05:18

Jan Harkes [off-list ref] writes:
When getting the list of all unpacked objects by walking the commit history,
we would stop traversal whenever we hit a packed commit. However the fact
that we found a packed commit does not guarantee that all previous commits
are also packed. As a result the commit walkers did not show all reachable
unpacked objects.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
Thanks.

With this, I think revs->unpacked should not mean "limited", so
I suspect this is also needed, no?
diff --git a/revision.c b/revision.c
index 93f2513..2d7cad9 100644
--- a/revision.c
+++ b/revision.c
@@ -1010,7 +1010,7 @@ int setup_revisions(int argc, const char
 		add_pending_object(revs, object, def);
 	}
 
-	if (revs->topo_order || revs->unpacked)
+	if (revs->topo_order)
 		revs->limited = 1;
 
 	if (revs->prune_data) {

Re: [PATCH] Continue traversal when rev-list --unpacked finds a packed commit.

From: Jan Harkes <jaharkes@cs.cmu.edu>
Date: 2016-08-11 20:43:16

On Mon, Oct 30, 2006 at 05:47:14PM -0800, Junio C Hamano wrote:
Jan Harkes [off-list ref] writes:
quoted
When getting the list of all unpacked objects by walking the commit history,
we would stop traversal whenever we hit a packed commit. However the fact
that we found a packed commit does not guarantee that all previous commits
are also packed. As a result the commit walkers did not show all reachable
unpacked objects.

Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu>
Thanks.

With this, I think revs->unpacked should not mean "limited", so
I suspect this is also needed, no?
I'm not familiar enough with the code to know for sure, but my gut
feeling is that that would be needed. Let me check...

When that flag is set, the code calls limit_list, which no longer stops
traversal when we hit a packed commit. So we end up with a list of all
commits in memory. If the flag is not set, the list is kept minimal and
parents are only traversed as they are encountered.

So it looks like not setting the flag reduces memory usage we traverse
all parents in both cases. Yes, you are correct.

Jan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help