Re: [PATCH v2 1/6] submodules: add helper functions to determine presence of submodules

2016-11-06 Thread Jacob Keller
On Tue, Nov 1, 2016 at 10:31 AM, Stefan Beller wrote: > On Tue, Nov 1, 2016 at 10:20 AM, Junio C Hamano wrote: > >> >> Maybe I am old fashioned, but I'd feel better to see these with >> explicit "extern" in front (check the older header files like >>

Re: [PATCH v2 1/6] submodules: add helper functions to determine presence of submodules

2016-11-04 Thread Jonathan Tan
On 10/31/2016 03:38 PM, Brandon Williams wrote: + struct strbuf buf = STRBUF_INIT; + char *submodule_url = NULL; + + strbuf_addf(, "submodule.%s.url", module->name); + ret = !git_config_get_string(buf.buf, _url); + +

Re: [PATCH v2 1/6] submodules: add helper functions to determine presence of submodules

2016-11-01 Thread Stefan Beller
On Tue, Nov 1, 2016 at 10:20 AM, Junio C Hamano wrote: > > Maybe I am old fashioned, but I'd feel better to see these with > explicit "extern" in front (check the older header files like > cache.h when you are in doubt what the project convention has been). I did check the

Re: [PATCH v2 1/6] submodules: add helper functions to determine presence of submodules

2016-11-01 Thread Brandon Williams
On 11/01, Junio C Hamano wrote: > Stefan Beller writes: > > Overall the suggestions from you in this review is good and please > consider anything I did not mention I agree with you. Thanks. > > >> +extern int is_submodule_initialized(const char *path); > >> +extern int

Re: [PATCH v2 1/6] submodules: add helper functions to determine presence of submodules

2016-11-01 Thread Brandon Williams
On 10/31, Stefan Beller wrote: > On Mon, Oct 31, 2016 at 3:38 PM, Brandon Williams wrote: > > +int is_submodule_checked_out(const char *path) > > +{ > > + int ret = 0; > > + struct strbuf buf = STRBUF_INIT; > > + > > + strbuf_addf(, "%s/.git", path); > > +

Re: [PATCH v2 1/6] submodules: add helper functions to determine presence of submodules

2016-11-01 Thread Junio C Hamano
Stefan Beller writes: Overall the suggestions from you in this review is good and please consider anything I did not mention I agree with you. Thanks. >> +extern int is_submodule_initialized(const char *path); >> +extern int is_submodule_checked_out(const char *path); > >

Re: [PATCH v2 1/6] submodules: add helper functions to determine presence of submodules

2016-10-31 Thread Stefan Beller
On Mon, Oct 31, 2016 at 3:38 PM, Brandon Williams wrote: > +int is_submodule_checked_out(const char *path) > +{ > + int ret = 0; > + struct strbuf buf = STRBUF_INIT; > + > + strbuf_addf(, "%s/.git", path); > + ret = file_exists(buf.buf); I think we can

[PATCH v2 1/6] submodules: add helper functions to determine presence of submodules

2016-10-31 Thread Brandon Williams
Add two helper functions to submodules.c. `is_submodule_initialized()` checks if a submodule has been initialized at a given path and `is_submodule_checked_out()` check if a submodule has been checked out at a given path. Signed-off-by: Brandon Williams --- submodule.c | 39