From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wincent Colaiuta Subject: Re: Understanding and improving --word-diff Date: Mon, 8 Nov 2010 18:35:48 +0100 Message-ID: <857393A7-596D-4848-A002-6AC06FF6B2EA@wincent.com> References: <20101108151601.GF22067@login.drsnuggles.stderr.nl> Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT Cc: git@vger.kernel.org, Thomas Rast , Johannes Schindelin To: Matthijs Kooijman X-From: git-owner@vger.kernel.org Mon Nov 08 18:52:38 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PFVtO-0006sZ-Ib for gcvg-git-2@lo.gmane.org; Mon, 08 Nov 2010 18:52:30 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753385Ab0KHRwY (ORCPT ); Mon, 8 Nov 2010 12:52:24 -0500 Received: from outmail148110.authsmtp.com ([62.13.148.110]:49402 "EHLO outmail148110.authsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752883Ab0KHRwX convert rfc822-to-8bit (ORCPT ); Mon, 8 Nov 2010 12:52:23 -0500 X-Greylist: delayed 965 seconds by postgrey-1.27 at vger.kernel.org; Mon, 08 Nov 2010 12:52:23 EST Received: from mail-c193.authsmtp.com (mail-c193.authsmtp.com [62.13.128.118]) by punt7.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id oA8Ha2tn022729; Mon, 8 Nov 2010 17:36:02 GMT Received: from zenyatta.unixhosts.net (ec2-184-73-234-210.compute-1.amazonaws.com [184.73.234.210]) (authenticated bits=128) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id oA8HZrWB083940 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 Nov 2010 17:35:54 GMT Received: from [192.168.1.6] (83.Red-88-5-247.dynamicIP.rima-tde.net [88.5.247.83]) (authenticated bits=0) by zenyatta.unixhosts.net (8.14.2/8.14.2) with ESMTP id oA8HZntv001381 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 8 Nov 2010 12:35:51 -0500 In-Reply-To: <20101108151601.GF22067@login.drsnuggles.stderr.nl> X-Mailer: Apple Mail (2.1081) X-Server-Quench: a38826c9-eb5e-11df-97bb-002264978518 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCd3ZggRAFZKTQIy FSICByJGVUMuIRha BAIHMQpCJFdJCUVH ahYdCF1NdwdEHAkR AmEBWFFeVVk/WGtx dQ1ScwdeZlRMXgV1 Uk1WQxwNZQ0Qa15m dB4WURB2d0tHe3l2 ZQgzXXhTXkIpfFso EEsBCGwHMTF9YWdN Al1YdwFWdgdDeRdA a1gxNiYHcQBZMi8i BBM6OTwwOzoXISJZ CgAINUgVX0cNEXZ5 Ag8FBzlqEUwLSU3l X-Authentic-SMTP: 61633436303433.1014:706 X-AuthFastPath: 0 (Was 255) X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On 08/11/2010, at 16:16, Matthijs Kooijman wrote: > Hi folks, > > I recently discovered --word-diff (or rather, --color-words and found > --word-diff when I started to hack on the git master version) and I had > hoped it would make the unified diffs generated by git-diff more > readable. [snip] > Inexact output > -------------- > Secondly, the --word-diff output currently never displays any changes to > the non-word (whitespace) parts of a file. This makes sense for the > LaTeX case, but sometimes you might want to get exact diff output > instead. At first glance this seems possible by specifiying a word-regex > of "." or something similar (i.e., make sure that the word regex matches > everything). But this is problematic for newlines. The documentation > states that stuff gets silently ignored if a newline ends up inside a > word. For the --word-diff=color format, this is probably a fixed > limitation of the otput format: you can't give a color to a newline (or > a space, for that matter). [snip] > Porcelain format > ---------------- > Lastly, the "porcelain" word-diff format seems a bit weird to me. Is > the format specified somewhere, or are there any programs that use it > currently? I couldn't find any users inside the git.git tree itself? > > Looking at the format itself, it's a bit unclear to me what the ~ lines > mean exactly. Commit 882749, which introduced the format says the mean > "newlines in the input", but I'm not sure if this means the old file, > new file or both. I posted along similar lines back in September: http://article.gmane.org/gmane.comp.version-control.git/156375 I found I couldn't really use the porcelain format due to information loss and ended up having to roll my own, parse the normal diff output and using that. Cheers, Wincent