git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Brandon Williams <bmwill@google.com>
Cc: Git List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>
Subject: Re: [PATCH] strbuf: add strbuf_add_real_path()
Date: Mon, 27 Feb 2017 23:45:50 +0100	[thread overview]
Message-ID: <3063b6fb-02aa-703c-0b56-300109cf054d@web.de> (raw)
In-Reply-To: <20170227182217.GC153455@google.com>

Am 27.02.2017 um 19:22 schrieb Brandon Williams:
> On 02/25, René Scharfe wrote:
>> +void strbuf_add_real_path(struct strbuf *sb, const char *path)
>> +{
>> +	if (sb->len) {
>> +		struct strbuf resolved = STRBUF_INIT;
>> +		strbuf_realpath(&resolved, path, 1);
>> +		strbuf_addbuf(sb, &resolved);
>> +		strbuf_release(&resolved);
>> +	} else
>> +		strbuf_realpath(sb, path, 1);
>
> I know its not required but I would have braces on the 'else' branch
> since they were needed on the 'if' branch.  But that's up to you and
> your style :)

Personally I'd actually prefer them as well, but the project's style has 
traditionally been to avoid braces on such trailing single-line branches 
to save lines.  The CodingGuidelines for this topic have been clarified 
recently, though, and seem to require them now.  Interesting.

René

  reply	other threads:[~2017-02-28  1:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-25 16:00 [PATCH] strbuf: add strbuf_add_real_path() René Scharfe
2017-02-25 20:11 ` Jeff King
2017-02-27 18:22 ` Brandon Williams
2017-02-27 22:45   ` René Scharfe [this message]
2017-02-28 20:42     ` Brandon Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3063b6fb-02aa-703c-0b56-300109cf054d@web.de \
    --to=l.s.r@web.de \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).