Re: [PATCH v2 2/7] git-p4: match branches case insensitively if configured
- From
- Mazo, Andrey <amazo@checkvideo.com>
- Date
- Mar 25, 2019, 17:20 UTC
- Message-ID
- <20190325172037.32373-1-amazo@checkvideo.com>
- In-Reply-To
- <CAE5ih7-W9vw4siwc=YQD36863LaCm1RzatAZ4Ajjk8MjYimOdA@mail.gmail.com>
From: "Mazo, Andrey" <amazo@checkvideo.com>
23.03.2019, 05:16, "Luke Diamand" <luke@diamand.org>:
Show 24 quoted lines
> On Thu, 21 Mar 2019 at 22:32, Mazo, Andrey <amazo@checkvideo.com> wrote: >> git-p4 knows how to handle case insensitivity in file paths >> if core.ignorecase is set. >> However, when determining a branch for a file, >> it still does a case-sensitive prefix match. >> This may result in some file changes to be lost on import. >> >> For example, given the following commits >> 1. add //depot/main/file1 >> 2. add //depot/DirA/file2 >> 3. add //depot/dira/file3 >> 4. add //depot/DirA/file4 >> and "branchList = main:DirA" branch mapping, >> commit 3 will be lost. >> >> So, do branch search case insensitively if running with core.ignorecase set. >> Teach splitFilesIntoBranches() to use the p4PathStartsWith() function >> for path prefix matches instead of always case-sensitive match. > > I wonder what other code paths break due to this problem! > > Looks reasonable but I fear there may be some other holes in there - > quickly looking through the code suggests there are several other > places this problem occurs.
From a quick search for .startswith(), I only see that stripRepoPath() might have a similar problem in useclientspec case. If you see other apparent problematic places, could you, please, point them out?
Or let me try to come up with a test case, and see what other places break.
Thank you, Andrey.