git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Michael Haggerty <mhagger@alum.mit.edu>,
	Tanay Abhra <tanayabh@gmail.com>, Git List <git@vger.kernel.org>
Subject: Re: [PATCH] commit.c:record_author_date() use skip_prefix() instead of starts_with()
Date: Mon, 3 Mar 2014 14:52:56 -0500	[thread overview]
Message-ID: <CAPig+cQrnKRDo88qq=3Ujjjwv0rn4H+eovAeAnmODUDPr00m8g@mail.gmail.com> (raw)
In-Reply-To: <xmqqmwh7qg6v.fsf@gitster.dls.corp.google.com>

On Mon, Mar 3, 2014 at 1:40 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Michael Haggerty <mhagger@alum.mit.edu> writes:
>
>>> -            if (!starts_with(buf, "author ")) {
>>> +            if (!skip_prefix(buf, "author ")) {
>>
>> If this is the only change, there is not much point, is there?  How does
>> this help?  Perhaps there is some way to take advantage of the
>> difference between starts_with() and skip_prefix() to simplify the rest
>> of the function?
>
> I admit I lost track, but wasn't there a discussion to use
> starts_with/ends_with when appropriate (namely, the caller is
> absolutely not interested in what the remainder of the string is
> after skipping the prefix), moving away from skip_prefix()?  Isn't
> this change going in the wrong direction?

Yes, it would be going in the wrong direction if this was all there
was to it, but the particular GSoC microproject [1] which inspired
this (incomplete) submission expects that the potential student will
dig deeper and discover how skip_prefix() can be used to achieve
greater simplification in record_author_date() and in other places in
the same file.

[1]: https://github.com/git/git.github.io/blob/master/SoC-2014-Microprojects.md

      reply	other threads:[~2014-03-03 19:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-01 19:48 [PATCH] commit.c:record_author_date() use skip_prefix() instead of starts_with() Tanay Abhra
2014-03-03  8:58 ` Michael Haggerty
2014-03-03 18:40   ` Junio C Hamano
2014-03-03 19:52     ` Eric Sunshine [this message]

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='CAPig+cQrnKRDo88qq=3Ujjjwv0rn4H+eovAeAnmODUDPr00m8g@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mhagger@alum.mit.edu \
    --cc=tanayabh@gmail.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 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 NNTP newsgroup(s).