]> git.ipfire.org Git - thirdparty/git.git/commit - t/t6423-merge-rename-directories.sh
t6423: more involved rules for renaming directories into each other
authorElijah Newren <newren@gmail.com>
Thu, 15 Oct 2020 20:46:30 +0000 (20:46 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Oct 2020 19:29:28 +0000 (12:29 -0700)
commitc64432aacda9054459ce550eca95929897c301bd
tree4fda98aa4965e5969fe4613c99f95211da237387
parent8536821d05697a6da991fbecc628058329f39364
t6423: more involved rules for renaming directories into each other

Testcases 12b and 12c were both slightly weird; they were marked as
having a weird resolution, but with the note that even straightforward
simple rules can give weird results when the input is bizarre.

However, during optimization work for merge-ort, I discovered a
significant speedup that is possible if we add one more fairly
straightforward rule: we don't bother doing directory rename detection
if there are no new files added to the directory on the other side of
the history to be affected by the directory rename.  This seems like an
obvious and straightforward rule, but there was one funny corner case
where directory rename detection could affect only existing files: the
funny corner case where two directories are renamed into each other on
opposite sides of history.  In other words, it only results in a
different output for testcases 12b and 12c.

Since we already thought testcases 12b and 12c were weird anyway, and
because the optimization often has a significant effect on common cases
(but is entirely prevented if we can't change how 12b and 12c function),
let's add the additional rule and tweak how 12b and 12c work.  Split
both testcases into two (one where we add no new files, and one where
the side that doesn't rename a given directory will add files to it),
and mark them with the new expectation.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/technical/directory-rename-detection.txt
t/t6423-merge-rename-directories.sh