Perforce not respecting the line endings config for a small number of files

26 Views Asked by At

I've created a workspace (on Windows) and set the line endings parameter to unix because I need each and every file to have LF line endings.

However, once everything was downloaded and synced, a small number of text files had CRLF as line endings. I couldn't find any pattern that would single them out.

There isn't any kind of rule. I have a folder full of msg_##.txt with ## going from 01 to 46. Every single file had LF line endings. Every single file except for msg_26.txt, which had CRLF. I've also two .py files in the same folder, one with LF, the other with CRLF. The CRLF one was quite big at 225KB, but I found no other pattern.

What reasons would there be for P4 to treat some of the files differently?

2

There are 2 best solutions below

2
Karlovsky120 On

Perforce assumes all of the files that were committed to the server have LF line endings. Because of that, when you choose unix as preferred line ending, perforce downloads files as is, since all the files on server have LF line endings anyway. The problem is, Perforce does not enforce that every file committed to the server has LF.

The files that were causing me problems were probably somehow stored on the server with CRLF line endings and that was what I got when I downloaded them.

1
Mark zegata On

I appreciate your concern regarding Perforce not adhering to the line endings configuration for certain files. To address this issue effectively, I recommend checking and adjusting the Perforce file type settings for the affected files. Additionally, consider reviewing any client-specific configurations that may be impacting the behavior. If the problem persists, reaching out to Perforce support or consulting their documentation for specific troubleshooting steps could provide further insights into resolving this issue."