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

Rewriting boundary parents when path-limiting

From
Paul Mackerras <paulus@samba.org>
Date
Feb 16, 2008, 12:10 UTC
Message-ID
<18358.53933.747911.449078@cargo.ozlabs.ibm.com>

When using both path and commit limiting, git log --parents --boundary rewrites the parents that are actually in the graph but doesn't rewrite the parents on the boundary, that is, the boundary parents may be commits that don't modify any of the specified paths. I'm wondering if there is a way to get the boundary parents rewritten too.

The reason is this. One of the nice things about the dev branch of gitk is that updating the graph is really quick, because the git log that gitk does when updating excludes all the commits that gitk has already seen, using commit limiting.

Without path limiting, that works nicely, and the boundary of the new set consists of commits that are already in the graph, so gitk can join the new graph into the old. But if path limiting is being used, the boundary commits of the new set aren't necessarily commits that are already in the graph, so gitk can't (at present) join the new graph to the old properly.

Here's an example: suppose the repository looks like this:
HEAD ->	c	modifies file x
	|
	b	modifies file y
	|
	a	modifies file x
Suppose you run "gitk -- x", so gitk will display:
	c
	|
	a

Then suppose commit c gets amended, and still modifies file x, so the HEAD is now commit c', whose parent is b. Then if you do "Update" in gitk (or press F5), gitk will do

	git log HEAD ^c -- x

and it will get one entry, which is c', with b listed as its parent. So then gitk ends up displaying:

	c'
	|
	b
	c
	|
	a

because it doesn't realize that the parent of c' in the path-limited graph should be a.

So can anyone suggest a good way for gitk to know that the parent of c' should be a in this situation?

Paul.
Next: Linus Torvalds
Message 1 of 3 in “Rewriting boundary parents when path-limiting”
  1. Paul MackerrasFeb 16, 2008
  2. Linus TorvaldsFeb 19, 2008
  3. Paul MackerrasFeb 24, 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.