Re: [RFH] bug in unpack_trees
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Mar 5, 2008, 15:56 UTC
- Message-ID
- <alpine.LFD.1.00.0803050750400.12253@woody.linux-foundation.org>
- In-Reply-To
- <alpine.LNX.1.00.0803050130190.19665@iabervon.org>
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