Re: [PATCH 66/67] use strbuf_complete to conditionally append slash

2015-09-21 Thread Jeff King
On Sun, Sep 20, 2015 at 09:50:28PM -0400, Eric Sunshine wrote: > > diff --git a/builtin/clean.c b/builtin/clean.c > > index df53def..d7acb94 100644 > > --- a/builtin/clean.c > > +++ b/builtin/clean.c > > @@ -159,8 +159,7 @@ static int is_git_repository(struct strbuf *path) > > int gitfile_

Re: [PATCH 66/67] use strbuf_complete to conditionally append slash

2015-09-20 Thread Eric Sunshine
On Tue, Sep 15, 2015 at 12:16 PM, Jeff King wrote: > When working with paths in strbufs, we frequently want to > ensure that a directory contains a trailing slash before > appending to it. We can shorten this code (and make the > intent more obvious) by calling strbuf_complete. > > Most of these c

Re: [PATCH 66/67] use strbuf_complete to conditionally append slash

2015-09-17 Thread Junio C Hamano
Jeff King writes: > On Wed, Sep 16, 2015 at 03:54:50PM -0700, Junio C Hamano wrote: > >> Jeff King writes: >> >> >> Is this conversion correct? This seems to me that the caller wants >> >> to create an IMAP folder name immediately under the root hierarchy >> >> and wants to have the leading sl

Re: [PATCH 66/67] use strbuf_complete to conditionally append slash

2015-09-16 Thread Jeff King
On Wed, Sep 16, 2015 at 03:54:50PM -0700, Junio C Hamano wrote: > Jeff King writes: > > >> Is this conversion correct? This seems to me that the caller wants > >> to create an IMAP folder name immediately under the root hierarchy > >> and wants to have the leading slash in the result. > > > > U

Re: [PATCH 66/67] use strbuf_complete to conditionally append slash

2015-09-16 Thread Junio C Hamano
Jeff King writes: >> Is this conversion correct? This seems to me that the caller wants >> to create an IMAP folder name immediately under the root hierarchy >> and wants to have the leading slash in the result. > > Ugh, you're right. This is the "other" style Eric mentioned earlier. > > This lo

Re: [PATCH 66/67] use strbuf_complete to conditionally append slash

2015-09-16 Thread Jeff King
On Wed, Sep 16, 2015 at 03:18:59PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > diff --git a/imap-send.c b/imap-send.c > > index 01aa227..f5d2b06 100644 > > --- a/imap-send.c > > +++ b/imap-send.c > > @@ -1412,8 +1412,7 @@ static CURL *setup_curl(struct imap_server_conf *srvc) > >

Re: [PATCH 66/67] use strbuf_complete to conditionally append slash

2015-09-16 Thread Junio C Hamano
Jeff King writes: > diff --git a/imap-send.c b/imap-send.c > index 01aa227..f5d2b06 100644 > --- a/imap-send.c > +++ b/imap-send.c > @@ -1412,8 +1412,7 @@ static CURL *setup_curl(struct imap_server_conf *srvc) > curl_easy_setopt(curl, CURLOPT_PASSWORD, server.pass); > > strbuf_addst

[PATCH 66/67] use strbuf_complete to conditionally append slash

2015-09-15 Thread Jeff King
When working with paths in strbufs, we frequently want to ensure that a directory contains a trailing slash before appending to it. We can shorten this code (and make the intent more obvious) by calling strbuf_complete. Most of these cases are trivially identical conversions, but there are two thi