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

Re: git-rev-list: add "--dense" flag

From
Jonas Fonseca <fonseca@diku.dk>
Date
Oct 25, 2005, 18:40 UTC
Message-ID
<20051025184030.GB7463@diku.dk>
In-Reply-To
<Pine.LNX.4.64.0510251110050.10477@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> wrote Tue, Oct 25, 2005:
Show 9 quoted lines
> On Tue, 25 Oct 2005, Jonas Fonseca wrote:
> > 
> > Is the initial commit supposed to be listed when the file has been added
> > later?
> 
> Right now --dense will _always_ show the root commit. I didn't do the 
> logic that does the diff against an empty tree. I was lazy.
> 
> This patch does that, and may or may not work.
Without the workaround below it segfaults.
> Does this match what you expected?
Yes, thanks.
diff --git a/rev-list.c b/rev-list.c
index 5f125fd..82ec656 100644
--- a/rev-list.c
+++ b/rev-list.c
@@ -87,6 +87,7 @@ static void rewrite_one(struct commit **
 		struct commit *p = *pp;
 		if (p->object.flags & (TREECHANGE | UNINTERESTING))
 			return;
+		if (!p->parents) return;
 		/* Only single-parent commits don't have TREECHANGE */
 		*pp = p->parents->item;
 	}
-- 
Jonas Fonseca
Previous: Linus TorvaldsNext: Linus Torvalds
Message 18 of 20 in “git-rev-list: add "--dense" flag”
  1. Linus TorvaldsOct 21, 2005
  2. Linus TorvaldsOct 21, 2005
  3. Linus TorvaldsOct 21, 2005
  4. Petr BaudisOct 22, 2005
  5. Handling renames.Petr Baudis, Oct 22, 2005
  6. Linus TorvaldsOct 22, 2005
  7. Petr BaudisOct 22, 2005
  8. Junio C HamanoOct 22, 2005
  9. Petr BaudisOct 22, 2005
  10. Linus TorvaldsOct 22, 2005
  11. Linus TorvaldsOct 22, 2005
  12. Petr BaudisOct 22, 2005
  13. Linus TorvaldsOct 22, 2005
  14. Junio C HamanoOct 22, 2005
  15. Linus TorvaldsOct 22, 2005
  16. Jonas FonsecaOct 25, 2005
  17. Linus TorvaldsOct 25, 2005
  18. Jonas FonsecaOct 25, 2005
  19. Linus TorvaldsOct 25, 2005
  20. Linus TorvaldsOct 25, 2005

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.