{"thread":{"id":"48701","subject":"[PATCH] RelNotes 2.18: clarify where directory rename detection applies","startedAt":"2018-06-12T23:58:05Z","lastAt":"2018-06-13T16:01:37Z","messageCount":2,"participants":["Elijah Newren","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"350032","messageId":"20180612235755.11309-1-newren@gmail.com","threadId":"48701","inReplyTo":null,"subject":"[PATCH] RelNotes 2.18: clarify where directory rename detection applies","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2018-06-12T23:57:55Z","receivedAt":"2018-06-12T23:58:05Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Mention that this feature works with some commands (merge and cherry-pick,\nimplying that it also works with commands that build on these like rebase\n-m and rebase -i).  Explicitly mentioning two commands hopefully implies\nthat it may not always work with other commands (am, and rebase without\nflags that imply either -m or -i).\n\nAlso, since the directory rename detection from this cycle was\nspecifically added in merge-recursive and not diffcore-rename, remove the\n'in \"diff\" family\" phrase from the note.  (Folks have requested in the\npast that `git diff` detect directory renames and somehow simplify its\noutput, so it may be helpful to avoid implying that diff has any new\ncapability here.)\n\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\nAfter thinking for a while about my RFC at\n  https://public-inbox.org/git/CABPp-BF4gbwVRHA3D1vqXuSnh3aS9XVLqtEUEmfmLDKPccyxtA@mail.gmail.com/\nthis commit seems like a simple fix.  We can discuss during the 2.19 and\n2.20 cycles what to do with rebase, if anything.\n\nAlso, if the above commit message feels incomplete without an explanation\nof why directory rename detection doesn't work with git-am, the following\ncould be included:\n\n\nMore details about the git-am limitation for the curious:\n\ngit-am tries to avoid a full three way merge, instead calling git-apply.\nThat prevents us from detecting renames at all, which may defeat the\ndirectory rename detection.  There is a fallback, though; if the initial\ngit-apply fails and the user has specified the -3 option, git-am will\nfall back to a three way merge.  However, git-am lacks the necessary\ninformation to do a \"real\" three way merge.  Instead, it has to use\nbuild_fake_ancestor() to get a merge base that is missing files whose\nrename may have been important to detect for directory rename detection\nto function.\n\nam-based rebases work by first generating a bunch of patches (which no\nlonger record what the original commits were and thus don't have the\nnecessary info from which we can find a real merge-base), and then\ncalling `git am`.  This implies that am-based rebases will not always\nsuccessfully detect directory renames either.  merged-based rebases\n(rebase -m) and cherry-pick-based rebases (rebase -i) are not affected\nby this shortcoming.\n\n Documentation/RelNotes/2.18.0.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/RelNotes/2.18.0.txt b/Documentation/RelNotes/2.18.0.txt\nindex ed80e5485b..449e49e0eb 100644\n--- a/Documentation/RelNotes/2.18.0.txt\n+++ b/Documentation/RelNotes/2.18.0.txt\n@@ -6,7 +6,7 @@ Updates since v2.17\n \n UI, Workflows & Features\n \n- * Rename detection logic in \"diff\" family that is used in \"merge\" has\n+ * Rename detection logic that is used in \"merge\" and \"cherry-pick\" has\n    learned to guess when all of x/a, x/b and x/c have moved to z/a,\n    z/b and z/c, it is likely that x/d added in the meantime would also\n    want to move to z/d by taking the hint that the entire directory\n-- \n2.18.0.rc0.3.gda9bce4c68\n\n"},{"id":"350063","messageId":"xmqqtvq67k10.fsf@gitster-ct.c.googlers.com","threadId":"48701","inReplyTo":"20180612235755.11309-1-newren@gmail.com","subject":"Re: [PATCH] RelNotes 2.18: clarify where directory rename detection applies","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-06-13T16:01:31Z","receivedAt":"2018-06-13T16:01:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elijah Newren <newren@gmail.com> writes:\n\n> Also, since the directory rename detection from this cycle was\n> specifically added in merge-recursive and not diffcore-rename, remove the\n> 'in \"diff\" family\" phrase from the note.\n\nThanks.\n"}]}