Perforce:防止 Perforce 改变文本文件格式 [英] Perforce: Keeping Perforce from altering text-file format

查看:59
本文介绍了Perforce:防止 Perforce 改变文本文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让 Perforce 在不将文件类型设置为二进制的情况下保留文本文件?或者除此之外,有没有办法告诉 Perforce 客户端比较二进制文件?二进制通常是不可取的,因为我失去了区分的能力.

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.

澄清:如果我在我的窗口客户端上编辑和更改 *.txt 文件,根据 DOS 格式,换行符将具有 CR+LF.但是如果我在 Unix 客户端上 P4 同步,它将只有 LF.无论 Perforce 客户端住在哪里,我都需要 Perforce 保持格式不变.

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.

最后,我使用 Perforce Windows 客户端 2006.2.

Finally, I'm on Perforce Windows client 2006.2.

提前致谢.

推荐答案

将所有客户端/工作区规范设置为unix"行尾.那么当您在 Windows 上签入时不会进行任何转换.

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

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

这篇关于Perforce:防止 Perforce 改变文本文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆