Phillip Wood <phillip.wood@xxxxxxxxxxxx> writes: > Yes, I think it probably makes sense to do that. Originally I didn't > count empty lines as context lines in case the user accidentally added > some empty lines at the end of the hunk but if 'git apply' does then I > think 'git add -p' should as well I am not sure if "adding to the tail" should be tolerated, but in any case, newer GNU diff can show an empty unaffected line as an empty line (unlike traditional unified context format in which such a line is expressed as a line with a lone SP on it), which is allowed as "implementation defined" by POSIX.1 [*1*]. Modern "git apply" knows about this. If "add -p" parses a patch, it should learn to do so, too. [Reference] *1* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html > >> Meanwhile, I can easily configure my editor not to do this for `*.diff` files. >> >> Thanks for your help, Phillip and Martin! > > Thanks for posting an example so we could test it, it makes it much > easier to track the problem down > > Best Wishes > > Phillip > >> Mahmoud, does this also explain your problem as per your original post? >>