Re: [PATCH] repository.c: always allocate 'index' at repo init time

2019-05-28 Thread Junio C Hamano
Duy Nguyen writes: > On Mon, May 20, 2019 at 8:17 PM Jeff King wrote: >> The patch looks good, though I wonder if we could simplify even further >> by just embedding an index into the repository object. The purpose of >> having it as a pointer, I think, is so that the_repository can point to >>

Re: [PATCH] repository.c: always allocate 'index' at repo init time

2019-05-21 Thread Jeff King
On Tue, May 21, 2019 at 05:34:02PM +0700, Duy Nguyen wrote: > > 2. There are hundreds of spots that need to swap out "repo->index" for > > "&repo->index". In the patch below I just did enough to compile > > archive-zip.o, to illustrate. :) > > You are more thorough than me. I saw #2 f

Re: [PATCH] repository.c: always allocate 'index' at repo init time

2019-05-21 Thread Duy Nguyen
On Mon, May 20, 2019 at 8:17 PM Jeff King wrote: > The patch looks good, though I wonder if we could simplify even further > by just embedding an index into the repository object. The purpose of > having it as a pointer, I think, is so that the_repository can point to > the_index. But we could pos

Re: [PATCH] repository.c: always allocate 'index' at repo init time

2019-05-20 Thread Jeff King
On Sun, May 19, 2019 at 09:56:36AM +0700, Nguyễn Thái Ngọc Duy wrote: > This patch goes with the second option, making sure that 'index' is > always allocated after initialization. It's less effort than the first > one, and also safer because you could still miss things during the code > audit. Th