git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] diff: Fix rename pretty-print when suffix and prefix overlap

From
Antoine Pelisse <apelisse@gmail.com>
Date
Feb 28, 2013, 22:22 UTC
Message-ID
<CALWbr2y7d5kGQpF=gBCkVx2ZgZR-9mmdhj17f2QcZZTaMPM_4w@mail.gmail.com>
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:
Show 21 quoted lines
> 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.
Show 5 quoted lines
> 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

Previous: Thomas RastNext: Junio C Hamano
Message 8 of 16 in “diff: Fix rename pretty-print when suffix and prefix overlap”
  1. diff: Fix rename pretty-print when suffix and prefix overlapAntoine Pelisse, Feb 23, 2013
  2. Junio C HamanoFeb 24, 2013
  3. Antoine PelisseFeb 25, 2013
  4. Philip OakleyFeb 25, 2013
  5. Antoine PelisseFeb 25, 2013
  6. diff: Fix rename pretty-print when suffix and prefix overlapAntoine Pelisse, Feb 28, 2013
  7. Thomas RastFeb 28, 2013
  8. Antoine PelisseFeb 28, 2013
  9. Junio C HamanoFeb 28, 2013
  10. tests: make sure rename pretty print worksAntoine Pelisse, Mar 2, 2013
  11. Junio C HamanoMar 3, 2013
  12. tests: make sure rename pretty print worksAntoine Pelisse, Mar 6, 2013
  13. Junio C HamanoMar 6, 2013
  14. diff: prevent pprint_rename from underrunning inputThomas Rast, Feb 26, 2013
  15. Junio C HamanoFeb 26, 2013
  16. Antoine PelisseFeb 27, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.