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

Re: git-rev-list bug?

From
Junio C Hamano <junkio@cox.net>
Date
Mar 10, 2006, 09:59 UTC
Message-ID
<7v4q26zklx.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7virqmzlhb.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 7 quoted lines
> I am wondering why try_to_simplify_commit() skips parents marked
> with UNINTERESTING.  I think this is causing a problem Catalin
> found with rev-list.
> ...
> The attached patch seems to fix it (without losing the logic to
> omit tree comparison with UNINTERESTING parent, which I do not
> quite understand).

Actually the previous patch is not right either. If I ask "what changes path B between commit#1..commit#4", it would still omit commit#2.

It should not matter if the parent is uninteresting while checking if a commit touches the specified path. The attached patch which replaces the previous botched one does exactly that.

It however has a side effect -- uninteresting commits were never parsed here, but now they get parsed. I am not sure if there are correctness implications...

---
diff --git a/revision.c b/revision.c
index 713f27e..9d0934a 100644
--- a/revision.c
+++ b/revision.c
@@ -296,11 +296,6 @@ static void try_to_simplify_commit(struc
 	while ((parent = *pp) != NULL) {
 		struct commit *p = parent->item;
 
-		if (p->object.flags & UNINTERESTING) {
-			pp = &parent->next;
-			continue;
-		}
-
 		parse_commit(p);
 		switch (compare_tree(p->tree, commit->tree)) {
 		case TREE_SAME:
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 9 in “git-rev-list bug?”
  1. Catalin MarinasMar 8, 2006
  2. Junio C HamanoMar 8, 2006
  3. Junio C HamanoMar 10, 2006
  4. Junio C HamanoMar 10, 2006
  5. Junio C HamanoMar 10, 2006
  6. Junio C HamanoMar 10, 2006
  7. Catalin MarinasMar 10, 2006
  8. Linus TorvaldsMar 10, 2006
  9. Junio C HamanoMar 10, 2006

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.