All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Duy Nguyen <pclouds@gmail.com>, Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 1/3] tree.c: update read_tree_recursive callback to pass strbuf as base
Date: Wed, 03 Dec 2014 08:13:08 -0800	[thread overview]
Message-ID: <xmqq1toglnjf.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAPig+cS1OK6pv5A0vuJf=j6eFrNv70=AYgVz3zQny-md15_xKg@mail.gmail.com> (Eric Sunshine's message of "Tue, 2 Dec 2014 19:11:44 -0500")

Eric Sunshine <sunshine@sunshineco.com> writes:

> On Tue, Dec 2, 2014 at 7:11 AM, Duy Nguyen <pclouds@gmail.com> wrote:
>> On Tue, Dec 2, 2014 at 2:32 AM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>>>
>>>> This allows the callback to use 'base' as a temporary buffer to
>>>> quickly assemble full path "without" extra allocation. The callback
>>>> has to restore it afterwards of course.
>>>
>>> Hmph, what's the quote around 'without' doing there?
>>
>> because it's only true if you haven't used up all preallocated space
>> in strbuf. If someone passes an empty strbuf, then underneath strbuf
>> may do a few realloc until the buffer is large enough.
>
> Would it be easier to understand if written like this?
>
>     This allows the callback to use 'base' as a temporary buffer to
>     quickly assemble full path, thus avoiding allocation/deallocation
>     for each iteration step.

Thanks.

I am not Duy so I do not know if that matches what he wanted to say,
or if it matches what the change gives us.  Your phrasing wouldn't
have made me say "Hmph...?" and it is an improvement that goes in
the right direction, I think.

A question during the review, especially on proposed log messages
and documentation changes, is rarely just a request to explain it to
the questioner in the discussion. It is an indication that what is
being commented on needs tweaking to be understood.

  reply	other threads:[~2014-12-03 16:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-30  9:04 [PATCH 0/3] ls-tree fixes Nguyễn Thái Ngọc Duy
2014-11-30  9:05 ` [PATCH 1/3] tree.c: update read_tree_recursive callback to pass strbuf as base Nguyễn Thái Ngọc Duy
2014-12-01 19:32   ` Junio C Hamano
2014-12-02 12:11     ` Duy Nguyen
2014-12-03  0:11       ` Eric Sunshine
2014-12-03 16:13         ` Junio C Hamano [this message]
2014-12-08 13:30           ` Duy Nguyen
2014-11-30  9:05 ` [PATCH 2/3] ls-tree: remove path filtering logic in show_tree Nguyễn Thái Ngọc Duy
2014-11-30  9:05 ` [PATCH 3/3] ls-tree: disable negative pathspec because it's not supported Nguyễn Thái Ngọc Duy
2014-12-01 19:40   ` Junio C Hamano
2014-12-02 12:14     ` Duy Nguyen
  -- strict thread matches above, loose matches on Subject: below --
2014-11-08 11:00 [PATCH 1/3] tree.c: update read_tree_recursive callback to pass strbuf as base Nguyễn Thái Ngọc Duy
2014-11-08 11:03 ` Duy Nguyen
2014-11-09  3:56 ` Eric Sunshine

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=xmqq1toglnjf.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.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.