Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15
DORMANTno replies

[EGIT PATCH] Avoid breaking the walk prematurely

From: Robin Rosenberg <hidden>
Date: 2016-06-15 22:45:41
Subsystem: the rest · Maintainer: Linus Torvalds

The optimization broke the walk when all changes we adds, assuming
the parent was an empty tree. This assumption was wrong. The tree does
not have to bee empty, it can contain other trees and blobs.

http://code.google.com/p/egit/issues/detail?id=46

Signed-off-by: Robin Rosenberg <redacted>
---
 .../spearce/jgit/revwalk/RewriteTreeFilter.java    |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

We could introduce a fixed version later on if we supply an option to select
whether to optimize the walk this way. The problem with doing it without an
option is that imports from legacy SCMs do not necessarily record file moves
as add/removes in direct sucession, but other events may happen in beteens
for various reasons.

-- robin 
diff --git a/org.spearce.jgit/src/org/spearce/jgit/revwalk/RewriteTreeFilter.java b/org.spearce.jgit/src/org/spearce/jgit/revwalk/RewriteTreeFilter.java
index 587d6d2..a5edbf0 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/revwalk/RewriteTreeFilter.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/revwalk/RewriteTreeFilter.java
@@ -118,13 +118,6 @@ public boolean include(final RevWalk walker, final RevCommit c)
 				//
 				c.flags |= REWRITE;
 				return false;
-			} else if (chgs == adds) {
-				// We added everything, so the parent may as well just
-				// be an empty tree. Kill our parent, we can assume
-				// it did not supply interesting changes.
-				//
-				c.parents = RevCommit.NO_PARENTS;
-				return true;
 			} else {
 				// We have interesting items, but neither of the special
 				// cases denoted above.
-- 
1.6.0.3.640.g6331a
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help