Page MenuHomePhabricator

In Git, only use "--find-copies-harder" on small diffs
ClosedPublic

Authored by epriestley on Jul 10 2016, 2:29 PM.
Tags
None
Referenced Files
F13059935: D16266.diff
Fri, Apr 19, 5:02 PM
Unknown Object (File)
Fri, Apr 12, 11:05 PM
Unknown Object (File)
Thu, Apr 11, 9:03 AM
Unknown Object (File)
Tue, Apr 2, 6:19 AM
Unknown Object (File)
Mon, Apr 1, 3:17 AM
Unknown Object (File)
Mon, Apr 1, 3:17 AM
Unknown Object (File)
Feb 10 2024, 12:31 PM
Unknown Object (File)
Feb 3 2024, 11:20 AM
Subscribers
None

Details

Summary

Ref T10423. This flag can cause git diff to take an enormously long time (the problem case was a 5M line, 20K file commit).

Instead:

  • Run without the flag first.
  • If that shows that the diff is definitely small, try again with the flag.
  • If that works, return the slower, better output.
  • If the fast diff affects too many paths or generating the slow diff takes too long, return the faster, slightly worse output.

The quality of the output differs in how well Git is able to detect "M" and "C" (moves and copies of files).

For example, if you copy src/ to srcpro/, the fast output may not show that you copied files. The slow output will.

I think this is rarely useful for large copies anyway: it's interesting if a 1-2 file diff is a copy, but usually obvious/uninteresting if a 500-file diff is a copy.

Test Plan
  • Ran bin/repository reparse --change rXnnn on Git changes.
  • Saw fast and slow commands execute normally.
  • Tried on a large diff, saw only the fast command execute.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to In Git, only use "--find-copies-harder" on small diffs.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Jul 10 2016, 2:40 PM
This revision was automatically updated to reflect the committed changes.