Re: [RFD] Combine diff improvements
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 15, 2013, 05:54 UTC
- Message-ID
- <7vboalw6lt.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CALWbr2zY3uo==QTd69t1eXNS4-CX1w3T-AaMjOLVmxj-SMJyvg@mail.gmail.com>
Antoine Pelisse <apelisse@gmail.com> writes:
Show 14 quoted lines
> While if we invert the two parents order we will have: > - 3 > --1 > --2 > - 4 > -3 > -4 > > While clearly, in both cases, the optimal solution would be close to: > - 3 > --1 > --2 > -3 > --4
We should shoot for better readability as the primary goal. When I am viewing "--cc" output, I find it easier to read if the lines for the same parent are consecutive. That is, I find the right one far easier to grok than the left one:
- 1 - 1
-2 - 3
- 3 -2
-4 -4when trying to see what got changed from the first parent (we had 1 and then 3 and whatever comes after this block; 2 and 4 are noise and it makes it easier to skip them because they are together).
This can probably be done as a post-process phase after you find the coalescing matches to express the result in the smallest number of lines, but I thought it is worth mentioning that not all solutions with the same number of lines are equally good.