Re: [PATCH] fix bug in read-cache.c which loses files when merging a tree

2005-04-18 Thread Linus Torvalds
On Mon, 18 Apr 2005, Petr Baudis wrote: > > So, I'm confused. Why did you introduce unpack-file instead of doing > just this? It was code that I already had (ie the old code from "merge-cache" just moved over), and thanks to that, I don't have to worry about broken "mktemp" crap in user space..

Re: [PATCH] fix bug in read-cache.c which loses files when merging a tree

2005-04-18 Thread Petr Baudis
Dear diary, on Mon, Apr 18, 2005 at 11:19:46PM CEST, I got a letter where Linus Torvalds <[EMAIL PROTECTED]> told me that... > I suspect that I should just pass in the SHA1 of the files to the > "merge-one-file-script" from "merge-cache", rather than unpacking it. > After all, the merging script

Re: [PATCH] fix bug in read-cache.c which loses files when merging a tree

2005-04-18 Thread Linus Torvalds
On Mon, 18 Apr 2005, James Bottomley wrote: > > I had a problem with the SCSI tree in that there's a file removal in one > branch. Your git-merge-one-file-script wouldn't have handled this > correctly: It seems to think that the file must be removed in both > branches, which is wrong. Yes, I a

Re: [PATCH] fix bug in read-cache.c which loses files when merging a tree

2005-04-18 Thread Linus Torvalds
On Mon, 18 Apr 2005, James Bottomley wrote: > > I noticed this when I tried a non-trivial scsi merge and checked the > results against BK. The problem is that remove_entry_at() actually > decrements active_nr, so decrementing it in add_cache_entry() before > calling remove_entry_at() is a double

[PATCH] fix bug in read-cache.c which loses files when merging a tree

2005-04-18 Thread James Bottomley
I noticed this when I tried a non-trivial scsi merge and checked the results against BK. The problem is that remove_entry_at() actually decrements active_nr, so decrementing it in add_cache_entry() before calling remove_entry_at() is a double decrement (hence we lose cache entries at the end). Ja