Re: [PATCH 11/11] refs: split and make get_*_ref_store() public API

2017-02-14 Thread Junio C Hamano
Duy Nguyen writes: > Long term, I think that's what Mike wants. Though the filter_ref_store > might return an (opaque) iterator instead of a ref store and > for_each_refstore() becomes a thin wrapper around the iterator > interface. Ah, yes, an iterator would be a lot more suitable abstraction t

Re: [PATCH 11/11] refs: split and make get_*_ref_store() public API

2017-02-14 Thread Duy Nguyen
On Wed, Feb 15, 2017 at 1:24 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> Direct call sites are just middle men though, e.g. >> for_each_ref_submodule(). I'll attempt to clean this up at some point >> in future (probably at the same time I attempt to kill *_submodule ref >> api). But I thi

Re: [PATCH 11/11] refs: split and make get_*_ref_store() public API

2017-02-14 Thread Stefan Beller
On Tue, Feb 14, 2017 at 2:04 AM, Duy Nguyen wrote: > On Tue, Feb 14, 2017 at 6:55 AM, Stefan Beller wrote: >>> >>> +/* >>> + * Return the ref_store instance for the specified submodule. For the >>> + * main repository, use submodule==NULL; such a call cannot fail. >> >> So now we have both a get_

Re: [PATCH 11/11] refs: split and make get_*_ref_store() public API

2017-02-14 Thread Junio C Hamano
Duy Nguyen writes: > Direct call sites are just middle men though, e.g. > for_each_ref_submodule(). I'll attempt to clean this up at some point > in future (probably at the same time I attempt to kill *_submodule ref > api). But I think for now I'll just put a TODO or FIXME comment here. So we'd

Re: [PATCH 11/11] refs: split and make get_*_ref_store() public API

2017-02-14 Thread Duy Nguyen
On Tue, Feb 14, 2017 at 6:55 AM, Stefan Beller wrote: >> >> +/* >> + * Return the ref_store instance for the specified submodule. For the >> + * main repository, use submodule==NULL; such a call cannot fail. > > So now we have both a get_main as well as a get_submodule function, > but the submodul

Re: [PATCH 11/11] refs: split and make get_*_ref_store() public API

2017-02-13 Thread Stefan Beller
> > +/* > + * Return the ref_store instance for the specified submodule. For the > + * main repository, use submodule==NULL; such a call cannot fail. So now we have both a get_main as well as a get_submodule function, but the submodule function can return the main as well? I'd rather see this as

[PATCH 11/11] refs: split and make get_*_ref_store() public API

2017-02-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 59 ++-- refs.h | 13 refs/files-backend.c | 2 +- refs/refs-internal.h | 12 --- 4 files changed, 48 insertions(+), 38 deletions(-) diff --git a/ref