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

Re: [PATCH 4/4] Make 'unpack_trees()' have a separate source and destination index

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Mar 7, 2008, 21:11 UTC
Message-ID
<alpine.LNX.1.00.0803071603170.19665@iabervon.org>
In-Reply-To
<8676ea8b0313abfc2e0946f45f636643e28aade8.1204856187.git.torvalds@linux-foundation.org>
On Thu, 6 Mar 2008, Linus Torvalds wrote:
Show 12 quoted lines
> We will always unpack into our own internal index, but we will take the
> source from wherever specified, and we will optionally write the result
> to a specified index (optionally, because not everybody even _wants_ any
> result: the index diffing really wants to just walk the tree and index
> in parallel).
> 
> This ends up removing a fair number more lines than it adds, for the
> simple reason that we can now skip all the crud that tried to be
> oh-so-careful about maintaining our position in the index as we were
> traversing and modifying it.  Since we don't actually modify the source
> index any more, we can just update the 'o->pos' pointer without worrying
> about whether an index entry got removed or replaced or added to.

It looks to me like it's leaking stuff stored in the index it creates if it ends up failing. I'm not entirely sure of the index lifecycle stuff, but it seems like it would be necessary. Aside from that, I think it should be right, although I haven't really gone over the resulting code in detail.

	-Daniel
*This .sig left intentionally blank*
Previous: Linus TorvaldsNext: Linus Torvalds
Message 8 of 11 in “Make unpack_trees() do separate source and destination indexes”
  1. 0/4 Make unpack_trees() do separate source and destination indexesLinus Torvalds, Mar 7, 2008
  2. 3/4 Make 'unpack_trees()' take the index to work on as an argumentLinus Torvalds, Mar 6, 2008
  3. 2/4 Add 'const' where appropriate to index handling functionsLinus Torvalds, Mar 6, 2008
  4. 1/4 Fix tree-walking compare_entry() in the presense of --prefixLinus Torvalds, Mar 6, 2008
  5. 4/4 Make 'unpack_trees()' have a separate source and destination indexLinus Torvalds, Mar 7, 2008
  6. Johannes SchindelinMar 7, 2008
  7. Linus TorvaldsMar 7, 2008
  8. Daniel BarkalowMar 7, 2008
  9. Linus TorvaldsMar 7, 2008
  10. Junio C HamanoMar 7, 2008
  11. Linus TorvaldsMar 7, 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.