git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* blame -C: adding a line in moved content sometimes affect blame result
@ 2011-06-08  5:09 Andrew Wong
  2011-06-09  1:31 ` Andrew Wong
  2011-06-09  3:25 ` Junio C Hamano
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Wong @ 2011-06-08  5:09 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

I've attached a script for illustration.

After moving content from file1 to file2, "git blame -C file2" correctly 
shows that the content came from file1. However, if I add a line in near 
the top or bottom of the moved content in file2, "git blame -C file2" 
fails to detect that the top or bottom of the moved contents came from 
file1. I looked around in blame.c, and this feels like a boundary case 
somewhere inside find_copy_in_blob? Any clues?

[-- Attachment #2: blame_issue.sh --]
[-- Type: application/x-sh, Size: 1060 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: blame -C: adding a line in moved content sometimes affect blame result
  2011-06-08  5:09 blame -C: adding a line in moved content sometimes affect blame result Andrew Wong
@ 2011-06-09  1:31 ` Andrew Wong
  2011-06-09  3:25 ` Junio C Hamano
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Wong @ 2011-06-09  1:31 UTC (permalink / raw)
  To: Andrew Wong; +Cc: git

On 11-06-08 1:09 AM, Andrew Wong wrote:
> I've attached a script for illustration.
>
> After moving content from file1 to file2, "git blame -C file2" 
> correctly shows that the content came from file1. However, if I add a 
> line in near the top or bottom of the moved content in file2, "git 
> blame -C file2" fails to detect that the top or bottom of the moved 
> contents came from file1. I looked around in blame.c, and this feels 
> like a boundary case somewhere inside find_copy_in_blob? Any clues?
Anyone has any ideas regarding this issue?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: blame -C: adding a line in moved content sometimes affect blame result
  2011-06-08  5:09 blame -C: adding a line in moved content sometimes affect blame result Andrew Wong
  2011-06-09  1:31 ` Andrew Wong
@ 2011-06-09  3:25 ` Junio C Hamano
  1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2011-06-09  3:25 UTC (permalink / raw)
  To: Andrew Wong; +Cc: git

Andrew Wong <andrew.kw.w@gmail.com> writes:
>
> After moving content from file1 to file2, "git blame -C file2"
> correctly shows that the content came from file1. However, if I add a
> line in near the top or bottom of the moved content in file2, "git
> blame -C file2" fails to detect that the top or bottom of the moved
> contents came from file1.

Probably your first few remaining lines of file2 are considered
insignificant copy by the logic in step 4 described in:

    http://thread.gmane.org/gmane.comp.version-control.git/28826

I didn't actually tried to follow what the code does to your exact input,
though.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-09  3:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-08  5:09 blame -C: adding a line in moved content sometimes affect blame result Andrew Wong
2011-06-09  1:31 ` Andrew Wong
2011-06-09  3:25 ` Junio C Hamano

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).