git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Tim Mazid <timmazid@hotmail.com>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
	Jonathan Nieder <jrnieder@gmail.com>,
	git@vger.kernel.org, Bo Yang <struggleyb.nku@gmail.com>
Subject: Re: Detection of relocations within a file
Date: Tue, 31 Aug 2010 03:43:03 +0200	[thread overview]
Message-ID: <201008310343.05280.jnareb@gmail.com> (raw)
In-Reply-To: <SNT124-W40BFB8E681711F9CD33D9AC4890@phx.gbl>

On Mon, 30 Aug 2010, Tim Mazid wrote:
> Matthieu Moy wrote:

> > 2. I am mystified not by some particular piece of code but by an
> > entire file.  The command
> > $ git gui blame -- git.c
> > works okay.
> 
> It does, to an extent.
> 
> The specific case I was thinking of is when, as a function grows
> larger, you decide to break it down and move a section of it to a new
> function.  Now, if the two lines remain exactly the same, there is no
> problem and git gui blame does the job.
>
> However, if there is any change in the line at all, even leading
> whitespace, as moving code around usually changes its "tabbage", then
> "git gui blame" will not detect that as being the same line of code
> sitting somewhere else, as it sees the two as "different".   
> Is there any way to get around this?
> 
> Further, in the previous point regarding a movement patch, it too
> should not be overly sensitive to leading whitespace. 
> 
> Actually, git in general shouldn't be too sensitive to leading
> whitespace (or at least should have an option to turn this on/off). 

You can always pass `-w' option to git-blame:

  -w   Ignore whitespace when comparing the parent's version and the
       child's to find where the lines came from.

I'm not sure if you can pass other diff whitespace options to git-blame
(-b, -w, --ignore-space-at-eol).


Note that "git gui blame" shows *two* blames: ordinary and '-C -C -w',
i.e. with copy detection and ignoring whitespace changes.

-- 
Jakub Narebski
Poland

  reply	other threads:[~2010-08-31  1:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30 17:13 Detection of relocations within a file Tim Mazid
2010-08-31  1:43 ` Jakub Narebski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-08-30 15:04 Tim Mazid
2010-08-30 15:44 ` Jonathan Nieder
2010-08-30 16:24   ` Matthieu Moy

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=201008310343.05280.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=struggleyb.nku@gmail.com \
    --cc=timmazid@hotmail.com \
    /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).