Binary files missing from crucible.py patch file for Perforce
Problem
When executing the crucible.py script to create a pre-commit patch file for review, specific file(s) are not included in the resulting patch file.
Diagnosis
To diagnose this issue, you will need to enable debug mode for crucible.py:
crucible.py -d
In your debug output, you will see the following:
stderr=
DEBUG:root:Omitting binary file
Cause
For Perforce, binaries are just one type of files that are excluded when generating patches using the crucible.py script. These file types currently are:
- binary
- xbinary
- ubinary
- uxbinary
- tempobj
- ctempobj
- xtempobj
- symlink
The omission of these files via the crucible.py script is by design.
Resolution
According to the Perforce User's Guide:
Perforce first determines whether the file is a regular file or a symbolic link, and then examines the first part of the file to determine whether it's text
or binary
. If any nontext characters are found, the file is assumed to be binary
; otherwise, the file is assumed to be text
.
If you believe that your file was marked as binary mistakenly, you are able to change the file type by specifying the following option in Perforce:
-t_{{filetype_}}