Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perforce: Keeping Perforce from altering text-file format

Is there a way to tell Perforce to leave text files alone without setting the file-type as binary? Or barring that, is there a way to tell the Perforce client to diff binaries? Binary usually isn't desirable, because I lose the ability to diff.

To clarify: If I edit and make changes to a *.txt file on my window client, newlines will have CR+LF as per the DOS format. But if I P4 sync on a Unix client, it will have LF only. I need Perforce to keep the format as-is, regardless of where the Perforce client lives.

That said, I do have a work-around: Set file-type as binary; and/or create a branch with text files set as "text", and integrate periodically back into the mainline where text files are set as "binary". But this is an overly-complicated work-around for what should be a very simple problem.

Finally, I'm on Perforce Windows client 2006.2.

Thanks in advance.

like image 994
hythlodayr Avatar asked Jan 28 '10 18:01

hythlodayr


1 Answers

Set all of your client/workspace specs to 'unix' line-endings. Then no conversion will take place when you check in on Windows.

See http://answers.perforce.com/articles/KB_Article/CR-LF-Issues-and-Text-Line-endings/

like image 113
Douglas Leeder Avatar answered Nov 27 '22 04:11

Douglas Leeder