Re: [PATCH 0/3] Teach Git about the patience diff algorithm
- From
Jeff King <peff@peff.net>
- Date
- Jan 2, 2009, 20:52 UTC
- Message-ID
- <20090102205208.GA9273@coredump.intra.peff.net>
- In-Reply-To
- <20090102195053.GA10876@coredump.intra.peff.net>
On Fri, Jan 02, 2009 at 02:50:53PM -0500, Jeff King wrote:
> For example, f83b9ba209's commit message indicates that it moves the > "--format-patch" paragraph. Which is what "git diff" shows. Patience > diff shows it as moving other text _around_ that paragraph.
Here's another interesting one: d592b315. The commit removes dashes from git commands in test scripts. Git says:
echo "tag-one-line" >expect &&
- git-tag -l | grep "^tag-one-line" >actual &&
+ git tag -l | grep "^tag-one-line" >actual &&
test_cmp expect actual &&
- git-tag -n0 -l | grep "^tag-one-line" >actual &&
+ git tag -n0 -l | grep "^tag-one-line" >actual &&
test_cmp expect actual &&
- git-tag -n0 -l tag-one-line >actual &&
+ git tag -n0 -l tag-one-line >actual &&
test_cmp expect actual &&whereas patience says:
echo "tag-one-line" >expect &&
- git-tag -l | grep "^tag-one-line" >actual &&
- test_cmp expect actual &&
- git-tag -n0 -l | grep "^tag-one-line" >actual &&
- test_cmp expect actual &&
- git-tag -n0 -l tag-one-line >actual &&
+ git tag -l | grep "^tag-one-line" >actual &&
+ test_cmp expect actual &&
+ git tag -n0 -l | grep "^tag-one-line" >actual &&
+ test_cmp expect actual &&
+ git tag -n0 -l tag-one-line >actual &&
test_cmp expect actual &&which is exactly what patience is advertised to do: it's treating the non-unique lines as uninteresting markers. But in this case they _are_ interesting, and I think the git output is more readable. And this is a case where your "weight lines by length instead of uniqueness" suggestion would perform better, I think.
-Peff