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

Re: Split up tree diff functions into tree-diff.c library

From
Junio C Hamano <junkio@cox.net>
Date
Oct 21, 2005, 06:16 UTC
Message-ID
<7v64rr2y4q.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0510202058030.10477@g5.osdl.org>

I have not closely studied the user of this change, rev-list, but I have a hunch that you might be better off, if you define a new diff "format", DIFF_FORMAT_CALLBACK, and hook into diff_flush(), instead of hooking into diff_addremove() and diff_change(). Instead of calling diff_flush_raw() or diff_flush_name(), or diff_flush_patch(), your callback function would be called with each filepair.

Right now, you are only making the parallel tree traversing and comparing part from diff-tree available in the library form (which is fine), but that way leaves the door open for it to also use the rest of the diffcore machinery.

By doing things this way, later round of rev-list that culls uninteresting commits could be taught to also follow renames.

Am I grossly off the mark?
Previous: Linus TorvaldsNext: Linus Torvalds
Message 2 of 3 in “Split up tree diff functions into tree-diff.c library”
  1. Linus TorvaldsOct 21, 2005
  2. Junio C HamanoOct 21, 2005
  3. Linus TorvaldsOct 21, 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.