All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: He Sun <sunheehnus@gmail.com>,
	Faiz Kothari <faiz.off93@gmail.com>, git <git@vger.kernel.org>
Subject: Re: [PATCH] implemented strbuf_write_or_die()
Date: Mon, 03 Mar 2014 12:35:44 -0800	[thread overview]
Message-ID: <xmqqsiqznhpb.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAPig+cTmejtWXRzr6qk-kd+P8j4b6xMJSUVnNnqObqNXc-S9UA@mail.gmail.com> (Eric Sunshine's message of "Mon, 3 Mar 2014 14:46:12 -0500")

Eric Sunshine <sunshine@sunshineco.com> writes:

> On Mon, Mar 3, 2014 at 1:31 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Eric Sunshine <sunshine@sunshineco.com> writes:
>>
>>> On Sat, Mar 1, 2014 at 7:51 AM, He Sun <sunheehnus@gmail.com> wrote:
>>>> 2014-03-01 19:21 GMT+08:00 Faiz Kothari <faiz.off93@gmail.com>:
>>>>> diff --git a/remote-curl.c b/remote-curl.c
>>>>> index 10cb011..dee8716 100644
>>>>> --- a/remote-curl.c
>>>>> +++ b/remote-curl.c
>>>>> @@ -634,7 +634,7 @@ static int rpc_service(struct rpc_state *rpc, struct discovery *heads)
>>>>>         if (start_command(&client))
>>>>>                 exit(1);
>>>>>         if (preamble)
>>>>> -               write_or_die(client.in, preamble->buf, preamble->len);
>>>>> +               strbuf_write_or_die(client.in, preamble);
>>>>>         if (heads)
>>>>>                 write_or_die(client.in, heads->buf, heads->len);
>>>>
>>>> This should be changed. May be you can use Ctrl-F to search write_or_die().
>>>> Or if you are using vim, use "/ and n" to find all.
>>>
>>> It's not obvious from the patch fragment, but 'heads' is not a strbuf,
>>> so Faiz correctly left this invocation alone.
>>
>> That is a very good sign why this change is merely a code-churn and
>> not an improvement, isn't it?  We know (and any strbuf user should
>> know) that ->buf and ->len are the ways to learn the pointer and the
>> length the strbuf holds.  Why anybody thinks it is benefitial to
>> introduce another function that is _only_ for writing out strbuf and
>> cannot be used to write out a plain buffer is simply beyond me.
>
> As a potential GSoC student and newcomer to the project, Faiz would
> not have known that this would be considered unwanted churn when he
> chose the task from the GSoC microproject page [1]. Perhaps it would
> be a good idea to retire this item from the list?

I don't think I saw this on the microproject suggestion page when I
last looked at it, and assumed that this was on the student's own
initiative.

> On the other hand, it did expose Faiz to the iterative code review
> process on this project and gave him a taste of what would be expected
> of him as a GSoC student, so the microproject achieved that important
> goal, and thus wasn't an utter failure.
>
> [1]: https://github.com/git/git.github.io/blob/master/SoC-2014-Microprojects.md

Surely.

I would have to say that this is not a good sample exercise to
suggest to new students and I'd encourage dropping it from the list.
You could argue that it is an effective way to cull people with bad
design taste to mix suggestions to make the codebase worse and see
who picks them, but I do not think it is very fair ;-)

  parent reply	other threads:[~2014-03-03 20:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-01 11:21 [PATCH] implemented strbuf_write_or_die() Faiz Kothari
2014-03-01 12:51 ` He Sun
2014-03-01 13:29   ` Faiz Kothari
2014-03-01 22:33     ` Michael Haggerty
2014-03-02  0:18       ` [PATCH v2] " Faiz Kothari
2014-03-02  2:47         ` Eric Sunshine
2014-03-02  2:55           ` Eric Sunshine
2014-03-02  7:34           ` [PATCH v3 1/2] Introduce strbuf_write_or_die() Faiz Kothari
2014-03-02  7:34             ` [PATCH v3 2/2] use strbuf_write_or_die() Faiz Kothari
2014-03-02 22:04               ` Eric Sunshine
2014-03-02 20:05             ` [PATCH v3 1/2] Introduce strbuf_write_or_die() Eric Sunshine
2014-03-02  3:08   ` [PATCH] implemented strbuf_write_or_die() Eric Sunshine
2014-03-03 18:31     ` Junio C Hamano
     [not found]       ` <CAFbjVckhU7NHzLjqPo5WkoBwVLrOLg=CS6mHSKkQstUxB31_eA@mail.gmail.com>
2014-03-03 18:48         ` Fwd: " Faiz Kothari
2014-03-03 19:46       ` Eric Sunshine
2014-03-03 19:51         ` David Kastrup
2014-03-03 20:35         ` Junio C Hamano [this message]
2014-03-03 21:29           ` Eric Sunshine
2014-03-04  9:18       ` Michael Haggerty
2014-03-04 17:01         ` Faiz Kothari
2014-03-04 18:45         ` Junio C Hamano
2014-03-01 21:34 ` Johannes Sixt
2014-03-03 18:27 ` 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=xmqqsiqznhpb.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=faiz.off93@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sunheehnus@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.