Re: [PATCH v3 14/25] setup.c: convert is_git_directory() to use strbuf

2014-02-20 Thread Eric Sunshine
On Tue, Feb 18, 2014 at 8:40 AM, Nguyễn Thái Ngọc Duy wrote: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > index 73e80ce..aec9fdb 100644 > --- a/strbuf.h > +++ b/strbuf.h > @@ -116,6 +116,10 @@ extern void strbuf_add(struct strbuf *, const void *, > size_t); > static inline void strbuf_addstr(s

Re: [PATCH v3 14/25] setup.c: convert is_git_directory() to use strbuf

2014-02-20 Thread Junio C Hamano
Junio C Hamano writes: > Duy Nguyen writes: > >> On Thu, Feb 20, 2014 at 3:17 AM, Junio C Hamano wrote: + strbuf_setlen(sb, len); + strbuf_add(sb, s, strlen(s)); >>> >>> I am not sure addstr_at() gives us a good abstraction, or at least >>> the name conveys what it does well n

Re: [PATCH v3 14/25] setup.c: convert is_git_directory() to use strbuf

2014-02-20 Thread Junio C Hamano
Duy Nguyen writes: > On Thu, Feb 20, 2014 at 3:17 AM, Junio C Hamano wrote: >>> + strbuf_setlen(sb, len); >>> + strbuf_add(sb, s, strlen(s)); >> >> I am not sure addstr_at() gives us a good abstraction, or at least >> the name conveys what it does well not to confuse readers. >> >> At fi

Re: [PATCH v3 14/25] setup.c: convert is_git_directory() to use strbuf

2014-02-20 Thread Duy Nguyen
On Thu, Feb 20, 2014 at 3:17 AM, Junio C Hamano wrote: >> + strbuf_setlen(sb, len); >> + strbuf_add(sb, s, strlen(s)); > > I am not sure addstr_at() gives us a good abstraction, or at least > the name conveys what it does well not to confuse readers. > > At first after only seeing its name

Re: [PATCH v3 14/25] setup.c: convert is_git_directory() to use strbuf

2014-02-19 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- (Only minor nits first during this round of review) > diff --git a/strbuf.h b/strbuf.h > index 73e80ce..aec9fdb 100644 > --- a/strbuf.h > +++ b/strbuf.h > @@ -116,6 +116,10 @@ extern void strbuf_add(struct strbuf *, cons

[PATCH v3 14/25] setup.c: convert is_git_directory() to use strbuf

2014-02-18 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- setup.c | 35 +++ strbuf.h | 4 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/setup.c b/setup.c index 6c3f85f..999225b 100644 --- a/setup.c +++ b/setup.c @@ -184,31 +184,34 @@ void verify_non_filenam