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 gits...@pobox.com 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

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

2014-02-20 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: On Thu, Feb 20, 2014 at 3:17 AM, Junio C Hamano gits...@pobox.com 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

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

2014-02-20 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Duy Nguyen pclo...@gmail.com writes: On Thu, Feb 20, 2014 at 3:17 AM, Junio C Hamano gits...@pobox.com 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

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 pclo...@gmail.com wrote: Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- 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

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 pclo...@gmail.com writes: Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- (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

[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 pclo...@gmail.com --- 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