{"thread":{"id":"26338","subject":"git: patch does not apply","startedAt":"2011-01-26T12:41:54Z","lastAt":"2011-01-26T17:43:35Z","messageCount":2,"participants":["Dmitri Pissarenko","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159889","messageId":"AANLkTi=ujfX53PXsfQXKf+1d5WQP=zMtzhKG-PSzT2_s@mail.gmail.com","threadId":"26338","inReplyTo":null,"subject":"git: patch does not apply","fromName":"Dmitri Pissarenko","fromEmail":"dmitri.pissarenko@gmail.com","sentAt":"2011-01-26T12:41:54Z","receivedAt":"2011-01-26T12:41:54Z","isPatch":false,"sender":{"key":"dmitri.pissarenko@gmail.com","avatar":null},"body":"Hello!\n\nI have a certain patch called my_pcc_branch.patch.\n\nWhen I try to apply it, I get following message:\n\n$ git apply --check my_pcc_branch.patch\nwarning: src/main/java/.../AbstractedPanel.java has type 100644, expected 100755\nerror: patch failed: src/main/java/.../AbstractedPanel.java:13\nerror: src/main/java/.../AbstractedPanel.java: patch does not apply\n\nWhat does it mean?\n\nHow can I fix this problem?\n\nNotes:\n\n1) I posted this question on StackOverflow and tried out several\nthings suggested there.\n\nhttp://stackoverflow.com/questions/4770177/git-patch-does-not-apply\n\nHowever, I don't have a working solution yet.\n\n2) I'm using git 1.7.3.1.mysgit.0 under Windows 7. The author of the\npatch uses Windows XP.\n\nThanks in advance\n\nDmitri\n"},{"id":"159896","messageId":"7vei7zlfw8.fsf@alter.siamese.dyndns.org","threadId":"26338","inReplyTo":"AANLkTi=ujfX53PXsfQXKf+1d5WQP=zMtzhKG-PSzT2_s@mail.gmail.com","subject":"Re: git: patch does not apply","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-26T17:43:35Z","receivedAt":"2011-01-26T17:43:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dmitri Pissarenko <dmitri.pissarenko@gmail.com> writes:\n\n> When I try to apply it, I get following message:\n>\n> $ git apply --check my_pcc_branch.patch\n> warning: src/main/java/.../AbstractedPanel.java has type 100644, expected 100755\n\nWhoever prepared the patch started off of the version of the file with\nexecutable bit dropped, while you still have a version with executable\nbit.  This is a warning and is not a cause for the patch not applying.\n\n> error: patch failed: src/main/java/.../AbstractedPanel.java:13\n> error: src/main/java/.../AbstractedPanel.java: patch does not apply\n\nThe tool looked at around line 13 of the APanel.java file because the\ninput, my_pcc_branch.patch, wanted to change things around there, but\ncouldn't find corresponding preimage.\n\n> What does it mean?\n\nThat is what it means.\n\n> How can I fix this problem?\n\nLook at the patch (find lines that perhaps begin with \"@@ -13,something\"\nafter \"diff --git a/...APanel.java b/...APanel.java\" appears), look at the\nAPanel.java file at around line 13, and see how they differ.  Discern what\nthe patch wanted to do, and make a corresponding edit to ...APanel.java\nfile.\n"}]}