Hello, developer! I use the latest version of patch-2.7.3,and find a problem ,it's maybe a bug . The following is the problem:
=================case 1======================= Then person A have file named a.txt a.txt: 11111111111 2222222222 3333333333 4444444444 5555555555 6666666666 7777777777 and person B modified it : a.txt: 11111111111 2222222222 aaaaaaaaaabbb bbbbbbbbbbbbb 3333333333 4444444444 5555555555 6666666666 7777777777 and person C modified it : 11111111111 2222222222 aaaaaaaaaabbb bbbbbbbbbbbbb 3333333333 4444444444 5555555555 6666666666 ccccccccccccc ddddddddddddd 7777777777 Then, B and C make patch : diff -Naur A/a.txt B/a.txt > ab.patch diff -Naur A/a.txt C/a.txt > ac.patch The person A got ab.patch and ac.patch from B and C . patch -d A/ -Nsp1 -i /pathto/ab.patch //ok patch -d A/ -Nsp1 -i /pathto/ac.patch //2 out of 2 hunks ignored Finally ,the a.txt is : 11111111111 2222222222 aaaaaaaaaabbb bbbbbbbbbbbbb 3333333333 4444444444 5555555555 6666666666 7777777777 I Think the second patch shoud give the answer :1 out of 2 hunks ignored ,and the finally result is : 11111111111 2222222222 aaaaaaaaaabbb bbbbbbbbbbbbb 3333333333 4444444444 5555555555 6666666666 ccccccccccccc ddddddddddddd 7777777777 but ,it is not expected. ================and the other case is success ================ if person C modified the file as : 11111111111 ddddddddddddd 2222222222 aaaaaaaaaabbb bbbbbbbbbbbbb 3333333333 4444444444 5555555555 6666666666 ccccccccccccc ddddddddddddd 7777777777 and other step are the same. I got the result : patch -d A/ -Nsp1 -i /pathto/ab.patch //ok patch -d A/ -Nsp1 -i /pathto/ac.patch //1 out of 2 hunks ignored the finally result: 11111111111 ddddddddddddd 2222222222 aaaaaaaaaabbb bbbbbbbbbbbbb 3333333333 4444444444 5555555555 6666666666 ccccccccccccc ddddddddddddd 7777777777 It's my expected result ! ============================================ the case 1 is failed without the two lines: ccccccccccccc ddddddddddddd and case 2 is ok! So , I think it is a problem! Thank you !