Re: [PATCH] diff: Fix rename pretty-print when suffix and prefix overlap
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 28, 2013, 22:29 UTC
- Message-ID
- <7vip5cgjhp.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1362088540-14564-1-git-send-email-apelisse@gmail.com>
Antoine Pelisse <apelisse@gmail.com> writes:
Show 17 quoted lines
> 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 ("/b/c"), but the same "/b/" is actually counted both in
> prefix and suffix. Then when calculating the size of the non-common part,
> we end-up with a negative value which is reset to 0, thus the "{ => }".
>
> Do not allow the common suffix to overlap the common prefix and stop
> when reaching a "/" that would be in both.
>
> Also add some test file to place corner-cases we could met (and this one)
> with rename pretty print.
>
> Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
> ---Hmm, haven't we already applied this with a fix from Thomas Rast and queued the result to 'next'?