Когда вы добавляете файл в Perforce, он пытается определить, какой это тип файла (текстовый, двоичный, utf16 и т. д.). Он хорошо справляется с этой задачей, но, по-видимому, никогда больше не проверяет тип файла после первоначальной отправки в систему контроля версий. Сотрудник недавно внес изменения в текстовый файл, который преобразовал его в Unicode (utf16). Perforce не распознал это и по-прежнему считал это типом текст, поэтому, когда другие извлекали файл, он был поврежден.
Мы исправили проблему, повторно отправив файл и явно изменив тип файла на utf16, но предпочли бы, чтобы это происходило автоматически. Есть способы заставить его всегда использовать определенный тип кодировки, но я не знаю, нравится ли мне эта идея. Кто-нибудь занимался и нашел решение этой проблемы?





Техническая поддержка Perforce сказала следующее:
Perforce does not check the content of the file when you submit an edit.
Checking every single file edit for content is potentially very expensive. "text" and "utf16" are not the only file types to look out for, a file could potentially change type from "text" to "binary" for example.
Another problem is that sometimes a user wants to override the default behavior of how Perforce recognizes a file. How should the server react in this case if the actual file type does not match the file type the user provides?
For these reasons Perforce will only determine the file type when the file is added, and take the "typemap" and the command parameter "-t" into account.
On the other hand, you can prevent your situation from happening again by employing a "change-content" trigger. This trigger would check the content of the file and compare it to the specified file type, rejecting any submit that creates a mismatch.
Может ли кто-нибудь указать, как это сделать? Я не знаком с триггерами или проверкой содержимого на предмет типа текста.