git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
Cc: git@vger.kernel.org
Subject: Re: Diff output from a rewrite of a function
Date: Thu, 8 Mar 2007 23:01:35 +0100	[thread overview]
Message-ID: <200703082301.35774.robin.rosenberg.lists@dewire.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0703082049060.19974@kivilampi-30.cs.helsinki.fi>

torsdag 08 mars 2007 20:04 skrev Ilpo Järvinen:
> Hi,
> 
> I have a C source file in which couple of functions are fully rewritten 
> (only a part of the file), almost no real similarities (block closing 
> parents will obviously match still and couple of other keyword lines here 
> and there). I wonder if there is way to produce diff that does not get 
> confused by the empty lines / identical lines that are present in both 
> original and the modified version. Default diff output is very bad looking 
> (IMHO) because these identical lines cause a "synchronization point" to 
> occur, that is, each identical line of the original is not considered as 
> +/- but left as is. Thus I have something like 3-6 add+del blocks per 
> function with a part of the change rather than e.g., one block per 
> function or so... I found -B from man git-diff-files, but I guess 
> "complete rewrite changes" means whole files as it did do anything.
> 
> Any ideas?
Increase the context size from the default three lines.  Something like
diff -U 7 old new will require larger chunks of unchanged code for diff
break up a hunk. With git you can do 

GIT_DIFF_OPTS=-u7 git-diff-....

> 
> I'm currently using 1.4.2, if that's significant.
> 
That was 1.5, but I think that part didn't change.

-- robin

  reply	other threads:[~2007-03-08 21:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-08 19:04 Diff output from a rewrite of a function Ilpo Järvinen
2007-03-08 22:01 ` Robin Rosenberg [this message]
2007-03-08 23:24   ` Junio C Hamano
2007-03-09  8:39     ` Ilpo Järvinen
2007-03-09 19:47     ` Robin Rosenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200703082301.35774.robin.rosenberg.lists@dewire.com \
    --to=robin.rosenberg.lists@dewire.com \
    --cc=git@vger.kernel.org \
    --cc=ilpo.jarvinen@helsinki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).