Code: Select all
‘-a’
‘--text’
Treat all files as text and compare them line-by-line, even if they
do not seem to be text. *Note Binary::.
‘-N’
‘--new-file’
If one file is missing, treat it as present but empty. *Note
Comparing Directories::.
‘-r’
‘--recursive’
When comparing directories, recursively compare any subdirectories
found. *Note Comparing Directories::.
In my example, the file was already text, it existed, and the targets were not directories. Thus, none of
-Nar were needed for my demonstration.
-r is usually needed for patches to be applied by Portage, unless you know exactly one file is different and name it explicitly.
-N is somewhat less often needed, as Portage patches usually do not create or remove whole files. Per
info diff, the text-versus-binary distinction is quite optimistic: it only considers a file as binary if null bytes are found near the start of the file. Therefore,
-a is probably rarely necessary for Portage patches. It might be more commonly needed if non-ANSI printable characters could trigger binary mode, but they do not.