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

Re: [PATCH] Reset the graph plotter internals when HEAD has changed.

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:44:43

Robin Rosenberg [off-list ref] wrote:
When we reset HEAD to an old revision it becomes more visible than when
we add a new commit. This is an intermediate solution.
Hmm.
 
quoted hunk ↗ jump to hunk
@@ -521,8 +524,18 @@ public class GitHistoryPage extends HistoryPage {
 		if (db == null)
 			return false;
 
+		final AnyObjectId headId;
+		try {
+			headId = db.resolve("HEAD");
+		} catch (IOException e) {
+			Activator.logError("Cannot parse HEAD in: "
+					+ db.getDirectory().getAbsolutePath(), e);
+			return false;
+		}
+
 		if (currentWalk == null || currentWalk.getRepository() != db
-				|| pathChange(pathFilters, paths)) {
+				|| pathChange(pathFilters, paths)
+				|| headId != null && !headId.equals(currentHeadId)) {
 			currentWalk = new SWTWalk(db);
Tossing the currentWalk just because HEAD changed to a different
commit shouldn't be necessary.  Its very heavy-handed.  Clearly
there is a bug in the plotter code where the reset does not clear
state right.

For now this is a reasonable work around.  I'll try to remember
to come back and debug this case in the future as tossing the
entire SWTWalk does reduce redraw performance.

Thanks for at least coming up with the work-around.

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