Re: [PATCH v2 2/7] git-p4: match branches case insensitively if configured

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Mazo, Andrey" <amazo@xxxxxxxxxxxxxx>


23.03.2019, 05:16, "Luke Diamand" <luke@xxxxxxxxxxx>:
> On Thu, 21 Mar 2019 at 22:32, Mazo, Andrey <amazo@xxxxxxxxxxxxxx> 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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux