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

Re: [POSSIBLE REGRESSION] Spurious revs after patch "revision.c: --full-history fix"

From
Linus Torvalds <torvalds@osdl.org>
Date
Jul 2, 2006, 17:14 UTC
Message-ID
<Pine.LNX.4.64.0607021012180.12404@g5.osdl.org>
In-Reply-To
<e5bfff550607020519k6007f41bne34d10c0e919f3c8@mail.gmail.com>
On Sun, 2 Jul 2006, Marco Costalba wrote:
> 
> What it seems is that with --parents  option two more spurious revs
> are printed out. This revs have nothing to do with builtin-add.c, the
> file is newer then both of them.
Gaah. Does this trivial patch fix it for you?

It had the wrong test for whether a commit was a merge. What it did was to say that a non-merge has exactly one parent (which sounds almost right), but the fact is, initial trees have no parent at all, but they're obviously not merges.

So the test for non-merge should be "!parents || !parents->next", not "parents && !parents->next".

		Linus
----
diff --git a/revision.c b/revision.c
index 1cf6276..880fb7b 100644
--- a/revision.c
+++ b/revision.c
@@ -997,7 +997,7 @@ struct commit *get_revision(struct rev_i
 				if (!revs->parents)
 					continue;
 				/* non-merge - always ignore it */
-				if (commit->parents && !commit->parents->next)
+				if (!commit->parents || !commit->parents->next)
 					continue;
 			}
 			if (revs->parents)
Previous: Marco CostalbaNext: Junio C Hamano
Message 2 of 4 in “[POSSIBLE REGRESSION] Spurious revs after patch "revision.c: --full-history fix"”
  1. Marco CostalbaJul 2, 2006
  2. Linus TorvaldsJul 2, 2006
  3. Junio C HamanoJul 2, 2006
  4. Marco CostalbaJul 2, 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.