Re: [BUG] All files in folder are moved when cherry-picking commit that moves fewer files
- From
Elijah Newren <newren@gmail.com>
- Date
- Feb 27, 2019, 16:02 UTC
- Message-ID
- <CABPp-BGbrWrS0622yfTRUqRzWzNsZ_v9cAWW6ucXBYXqD26qHA@mail.gmail.com>
- In-Reply-To
- <512993fe-51da-745d-031b-37ea162499fb@gmail.com>
Hi,
On Wed, Feb 27, 2019 at 6:30 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 12 quoted lines
> > Hi Linus > > On 27/02/2019 12:47, Linus Nilsson wrote: > > Hi > > > > I have found what I suspect to be a bug, or at least not desirable behavior in my case. In one branch, I have moved all files in a directory to another directory. The first directory is now empty in this branch (I haven't tested whether this is significant). > > I suspect that because you've moved all the files git thinks the > directory has been renamed and that's why it moves a/file2 when fix is > cherry-picked in the example below. I've cc'd Elijah as he knows more > about how the directory rename detection works.
Yes, Phillip is correct. If the branch you were merging/cherry-picking still had any files at all in the original directory, then no directory rename would be detected. You can read up more details about how it works at https://git.kernel.org/pub/scm/git/git.git/tree/Documentation/technical/directory-rename-detection.txt