git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Antoine Pelisse <apelisse@gmail.com>
To: Thomas Rast <trast@student.ethz.ch>
Cc: git <git@vger.kernel.org>
Subject: Re: [PATCH] diff: Fix rename pretty-print when suffix and prefix overlap
Date: Thu, 28 Feb 2013 23:22:05 +0100	[thread overview]
Message-ID: <CALWbr2y7d5kGQpF=gBCkVx2ZgZR-9mmdhj17f2QcZZTaMPM_4w@mail.gmail.com> (raw)
In-Reply-To: <874ngw2ii0.fsf@pctrast.inf.ethz.ch>

On Thu, Feb 28, 2013 at 11:14 PM, Thomas Rast <trast@student.ethz.ch> wrote:
> Antoine Pelisse <apelisse@gmail.com> writes:
>
>> diff --git a/diff.c b/diff.c
>> index 9038f19..e1d82c9 100644
>> --- a/diff.c
>> +++ b/diff.c
>> @@ -1177,7 +1177,16 @@ static char *pprint_rename(const char *a, const char *b)
>> -     while (a <= old && b <= new && *old == *new) {
>> +     /*
>> +      * Note:
>> +      * if pfx_length is 0, old/new will never reach a - 1 because it
>> +      * would mean the whole string is common suffix. But then, the
>> +      * whole string would also be a common prefix, and we would not
>> +      * have pfx_length equals 0.
>> +      */
>> +     while (a + pfx_length - 1 <= old &&
>> +            b + pfx_length - 1 <= new &&
>> +            *old == *new) {
>
> Umm, you still have the broken version here, and the previous patch is
> already in next.  I think you should decide for one thing ;-)

Thanks ! I had not paid enough attention to that.

> Either: consider this a reroll; Junio would have to revert the version
> already in next (which isn't _so_ bad, because next will eventually be
> rebuilt) and apply this new version.  But if you do that, you should
> squash my change that deals with the underrun issue (I'd be fine with
> that).

I would not have done that without your consent (that's why I kept the
buggy version)

> Or: consider it an incremental improvement on the series, in which case
> you should send only the tests with a new commit message.

That seems like the best solution to me. I will resend later with just
the tests and a new commit message.

Cheers,
Antoine

  reply	other threads:[~2013-02-28 22:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-23 16:48 [PATCH] diff: Fix rename pretty-print when suffix and prefix overlap Antoine Pelisse
2013-02-24  9:15 ` Junio C Hamano
2013-02-25 19:50   ` Antoine Pelisse
2013-02-25 22:36     ` Philip Oakley
2013-02-25 22:41       ` Antoine Pelisse
2013-02-28 21:55     ` Antoine Pelisse
2013-02-28 22:14       ` Thomas Rast
2013-02-28 22:22         ` Antoine Pelisse [this message]
2013-02-28 22:29       ` Junio C Hamano
2013-03-02 14:38         ` [PATCH] tests: make sure rename pretty print works Antoine Pelisse
2013-03-03  6:50           ` Junio C Hamano
2013-03-06 21:36           ` [PATCH v2] " Antoine Pelisse
2013-03-06 22:03             ` Junio C Hamano
2013-02-26 20:47 ` [PATCH] diff: prevent pprint_rename from underrunning input Thomas Rast
2013-02-26 21:44   ` Junio C Hamano
2013-02-27 13:27     ` Antoine Pelisse

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='CALWbr2y7d5kGQpF=gBCkVx2ZgZR-9mmdhj17f2QcZZTaMPM_4w@mail.gmail.com' \
    --to=apelisse@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=trast@student.ethz.ch \
    /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).