Use a lower copy_threshold when doing blame



10 months ago
10 months ago


(Reporter: billm, Unassigned)



Firefox Tracking Flags

(Not tracked)


From Masayuki:

> This file was copied from dom/base/Selection.cpp and its unnecessary lines were
> removed (for separating the file to two files).
> The patch is here:
> So, nsFrameSelection.cpp should be displayed with the blame of old Selection.cpp like hgweb.
> However, searchfox shows all lines of it are changed by the patch. This is not useful information. Could you check it?

The problem is that Searchfox uses Git rather than Mercurial, and Git tries to infer file copies and renames rather than requiring the user to point them out. It uses a heuristic where a file is treated as copied only if 50% or more of the contents of the file are preserved. It looks like that's not true in this case. If I do |git show 083cd9d905c747cc195c1ece60202a68a1c99ed0| (which is the part 2 revision from bug 1373999) then all the lines in dom/base/Selection.cpp are shown as new. However, if I do |git show 083cd9d905c747cc195c1ece60202a68a1c99ed0 -C40|, then it recognizes that the file was copied from layout/generic/nsFrameSelection.cpp. The latter command only requires 40% of the file to be the same.

It probably makes sense to change Searchfox to use a lower copy threshold.
You need to log in before you can comment on or make changes to this bug.