git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jun 10, 2008, 00:40 UTC
Message-ID
<20080610004046.GE4389@spearce.org>
In-Reply-To
<1213051816-4046-2-git-send-email-robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> 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.
 
Show 18 quoted lines
> @@ -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.
Previous: Robin RosenbergNext: Shawn O. Pearce
Message 9 of 11 in “[EGIT PATCHES] Assorted minor fixes”
  1. Robin RosenbergJun 9, 2008
  2. Reset the graph plotter internals when HEAD has changed.Robin Rosenberg, Jun 9, 2008
  3. Make it possible to create a new Git repository in project parent directory.Robin Rosenberg, Jun 9, 2008
  4. Fix a typo.Robin Rosenberg, Jun 9, 2008
  5. Drop an unused empty menu contribution.Robin Rosenberg, Jun 9, 2008
  6. Check content if necessary when decorations want to know statusRobin Rosenberg, Jun 9, 2008
  7. Fix the context menu connection to the workbenchRobin Rosenberg, Jun 9, 2008
  8. Add a Track toolbar icon for adding resourcesRobin Rosenberg, Jun 9, 2008
  9. Shawn O. PearceJun 10, 2008
  10. Shawn O. PearceJun 10, 2008
  11. Robin RosenbergJun 10, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.