Re: [PATCH] read-tree --aggressive
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:18
Junio C Hamano [off-list ref] writes:
This patch would not help recursive strategy, though. Calling read-tree with --aggressive flag essentially disables the benefit we would expect to get from it -- rename detection.
I think we could fairly easily tweak this by trying at least half of the rename detection inside read-tree. That would make it usable by merge-recursive as well. Instead of doing "aggressive" in the threeway_merge function first, we can process the stages without it in the first pass, and run an equivalent of diff-stages -M internally between stage #2 and stage #3, and keep the matched paths unmerged (we need to mark these paths somehow). After that, we can do "aggressive" collapsing to reduce the amount of trivial merges that recursive does not have to look at for renaming merges. If we are ambitious, we could go further. We could actually move the stages around after running the rename detection diff between stages #2 and #3, along with working tree files as needed. Then merge-resolve would be able to do the renaming merge similar to merge-recursive.