Re: [RFH] bug in unpack_trees
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:44:20
On Wed, 5 Mar 2008, Daniel Barkalow wrote:
The thing that's hopeless isn't including the index; it's including the index that's simultaneously being regenerated.
Yeah. I was thinking about just putting the result in a new index. It's *usually* what the user wants anyway. The whole complexity with updating the old index is really nasty. There are other complexities there, but the index one is the worst. When doing a stupid try at using "traverse_trees()" (which in itself was not that easy - traverse_trees() is a fundamentally simpler walker and _different_ enough to not match well), one of the bigger issues is that traverse_trees() wants to do the directories in a separate phase from the files (becasue they sort differently), and that coupled with the fact that we do a kind of "read-modify-write" on the index makes it all really ugly. I'm still working on it, but it's nastier than I was hoping for. Maybe you can come up with a better solution. Linus