From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Stefan Beller <sbeller@google.com>, Jeff King <peff@peff.net>,
Git List <git@vger.kernel.org>
Subject: Re: [PATCH] prefix_path(): Unconditionally free result of prefix_path
Date: Mon, 04 May 2015 15:29:32 -0700 [thread overview]
Message-ID: <xmqq8ud4ou2b.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAPig+cSuCouNCuKa99mct4UMPykuMVy3+7sqB6y+v+UtP2oeTw@mail.gmail.com> (Eric Sunshine's message of "Mon, 4 May 2015 16:19:26 -0400")
Eric Sunshine <sunshine@sunshineco.com> writes:
> On Mon, May 4, 2015 at 3:11 PM, Stefan Beller <sbeller@google.com> wrote:
>> prefix_path(): Unconditionally free result of prefix_path
>
> Slightly redundant mention of "prefix_path". Also, prevailing custom
> is to drop capitalization.
>
>> prefix_path() always returns a newly allocated string since
>> d089eba (setup: sanitize absolute and funny paths in get_pathspec(),
>> 2008-01-28)
>
> I'd probably turn this sentence fragment into a proper sentence:
>
> As of d089eba (...), prefix_path() always returns a newly
> allocated string, so free its result unconditionally.
>
>> Additionally the const is dropped from the pointers, so the call to
>> free doesn't need a cast.
>
> Imperative mood:
>
> Additionally, drop the const from variables to which the
> prefix_path() result is assigned so they can be free()'d
> without having to cast-away constness.
>
>> Signed-off-by: Stefan Beller <sbeller@google.com>
>> ---
>>
>> Notes:
>> Thanks for all the suggestions!
>> They are incorporated into this version of the patch.
>
> Thanks, this version looks much better.
>
> FWIW, with or without addressing the very minor nits above:
>
> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Thanks, both.
To save a round-trip, I'll munge the log message myself stealing
Eric's suggestions.
next prev parent reply other threads:[~2015-05-04 22:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-04 19:11 [PATCH] prefix_path(): Unconditionally free result of prefix_path Stefan Beller
2015-05-04 20:19 ` Eric Sunshine
2015-05-04 22:29 ` Junio C Hamano [this message]
2015-05-05 3:21 ` Jeff King
2015-05-05 16:28 ` Stefan Beller
2015-05-05 17:36 ` Junio C Hamano
2015-05-05 17:56 ` Jeff King
2015-05-05 18:09 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq8ud4ou2b.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=sbeller@google.com \
--cc=sunshine@sunshineco.com \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.