Hosts diff file is a descriptive script. Purpose of hosts diff file is to share host maps between different endpoints across different OS and keep observable consistency after patch it to exist hosts files.
A [hosts diff] file consists of one or more [patch lines]. Each patch line discribe a operation should be applied to the whole hosts file.
When patching, [patch lines] will be read and parsed, then applied one by one. Each patch line is applied to hosts lines already patched by all lines before it. That is, patching result is not only determined by current patch line, but also by all [patch lines] adopted before. Hence, hosts diff is sequence dependent. Remove some lines by hostname then add a new map line of the same hostname is totally different from add then remove.