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

2013-02-28 Thread Junio C Hamano
Antoine Pelisse writes: > When considering a rename for two files that have a suffix and a prefix > that can overlap, a confusing line is shown. As an example, renaming > "a/b/b/c" to "a/b/c" shows "a/b/{ => }/b/c", instead of "a/b/{b => }/c" > > Currently, what we do is calculate the common pref

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

2013-02-28 Thread Antoine Pelisse
On Thu, Feb 28, 2013 at 11:14 PM, Thomas Rast wrote: > Antoine Pelisse 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 <=

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

2013-02-28 Thread Thomas Rast
Antoine Pelisse 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: > + * i

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

2013-02-28 Thread Antoine Pelisse
When considering a rename for two files that have a suffix and a prefix that can overlap, a confusing line is shown. As an example, renaming "a/b/b/c" to "a/b/c" shows "a/b/{ => }/b/c", instead of "a/b/{b => }/c" Currently, what we do is calculate the common prefix ("a/b/"), and the common suffix

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

2013-02-25 Thread Antoine Pelisse
>>> In this example, the common prefix would be "a/b/" and the common >>> suffix that does not overlap with the prefix part would be "/c", so >>> I am imagining that "a/b/{ => b}/c" would be the desired output? >> >> >> Yes, at least that's what I expected. > > > Surely it would be "a/b/{b => }/c",

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

2013-02-25 Thread Philip Oakley
On 25/02/13 19:50, Antoine Pelisse wrote: On Sun, Feb 24, 2013 at 10:15 AM, Junio C Hamano wrote: Antoine Pelisse writes: When considering a rename for two files that have a suffix and a prefix that can overlap, a confusing line is shown. As an example, renaming "a/b/b/c" to "a/b/c" shows "a

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

2013-02-25 Thread Antoine Pelisse
On Sun, Feb 24, 2013 at 10:15 AM, Junio C Hamano wrote: > Antoine Pelisse writes: > >> When considering a rename for two files that have a suffix and a prefix >> that can overlap, a confusing line is shown. As an example, renaming >> "a/b/b/c" to "a/b/c" shows "a/b/{ => }/b/c". > > This would be

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

2013-02-24 Thread Junio C Hamano
Antoine Pelisse writes: > When considering a rename for two files that have a suffix and a prefix > that can overlap, a confusing line is shown. As an example, renaming > "a/b/b/c" to "a/b/c" shows "a/b/{ => }/b/c". This would be vastly more readable if it had "It should show XXX instead" somewh

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

2013-02-23 Thread Antoine Pelisse
When considering a rename for two files that have a suffix and a prefix that can overlap, a confusing line is shown. As an example, renaming "a/b/b/c" to "a/b/c" shows "a/b/{ => }/b/c". Currently, what we do is calculate the common prefix ("a/b/"), and the common suffix ("/b/c"), but the same "/b/