3 ms·
After reading the man page for diff and the -e option, I found that they actually generate the diff hunks from the end of the file to the beginning in order to
by u801e 8y ago
After reading the man page for diff and the -e option, I found that they actually generate the diff hunks from the end of the file to the beginning in order to keep the start line numbers consistent. I wonder why the other diff formats decided to do it the other way around (from beginning to end)? Doing it from end to beginning actually makes it easier to apply individual hunks without having to regenerate the diff after applying one (assuming you start with a later hunk before applying earlier ones).