0

Suppose I have in the past split out a smaller file from a larger one. The larger one is still in place:

large.txt   -->     large.txt
            \->     excerpt.txt

Now, I've made a change to excerpt.txt that I'd like to cherry-pick back to a version of the repo before it was split out of large.txt.

Since large.txt was modified when excerpt.txt was extracted from it, I expected git to figure out where the excerpt.txt content came from an be clever enough to patch up the same content in large.txt instead. But it doesn't, creating a copy of excerpt.txt when cherry-picking and claiming it conflicts.

I have cranked up merge.renamelimit to an insanely high number, but it doesn't even attempt to use inexact rename detection, because I don't see the corresponding progress report (the repo is large enough for this to be slow enough for me to notice).

Anything else I can do to make git find the source of the content and patch it there?

Marc Mutz - mmutz
  • 24,485
  • 12
  • 80
  • 90

1 Answers1

0

I expected git to figure out where the excerpt.txt content came from an be clever enough to patch up the same content in large.txt instead ...

You're expecting more cleverness than Git actually has.

... I have cranked up merge.renamelimit

You'd actually need for git merge to do a copy-detection rather than a rename-detection here. Both detection systems use a lot of the same code, but git merge doesn't run any copy detection at all (at least currently).

torek
  • 448,244
  • 59
  • 642
  • 775