{"thread":{"id":"12858","subject":"Apply patch on server w/o git","startedAt":"2008-03-25T18:25:58Z","lastAt":"2008-03-29T18:46:06Z","messageCount":7,"participants":["Joe Fiorini","Bryan Donlan","Jan Hudec","Robin Rosenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"73055","messageId":"CA08AA77-A9EA-4490-B1BE-25E8B7402290@faithfulgeek.org","threadId":"12858","inReplyTo":null,"subject":"Apply patch on server w/o git","fromName":"Joe Fiorini","fromEmail":"joe@faithfulgeek.org","sentAt":"2008-03-25T18:25:58Z","receivedAt":"2008-03-25T18:25:58Z","isPatch":false,"sender":{"key":"joe@faithfulgeek.org","avatar":null},"body":"I am trying to generate a diff patch on my local dev box.  I want to  \nupload this patch to a server (running Windows Server 2008) and apply  \nit to my staging code.  The catch is: I cannot install git on the  \nserver to accept the patch.  Therefore, I would like to use a generic  \npatching tool (such as patch from the GnuWin32 tools).  I tried  \ngenerating a unified diff with the following command:\n\ngit diff -U > diff.patch\n\nand then tried to apply it using:\n\npatch -u -i ..\\other_dir\\diff.patch\n\nand I got the error:\n\n\"patch unexpectedly ends in middle of line\" ... \"Only garbage was  \nfound in the patch input\"\n\nIt might be a problem with how I'm using patch, and if so, forgive  \nme.  If not, then how can I generate a generic diff format from git so  \nI can do what I want?\n\nThanks all!\nJoe Fiorini\n"},{"id":"73058","messageId":"3e8340490803251141x6d199d8ch8828b396da202d81@mail.gmail.com","threadId":"12858","inReplyTo":"CA08AA77-A9EA-4490-B1BE-25E8B7402290@faithfulgeek.org","subject":"Re: Apply patch on server w/o git","fromName":"Bryan Donlan","fromEmail":"bdonlan@gmail.com","sentAt":"2008-03-25T18:41:04Z","receivedAt":"2008-03-25T18:41:04Z","isPatch":false,"sender":{"key":"bdonlan@gmail.com","avatar":null},"body":"On Tue, Mar 25, 2008 at 2:25 PM, Joe Fiorini <joe@faithfulgeek.org> wrote:\n> I am trying to generate a diff patch on my local dev box.  I want to\n>  upload this patch to a server (running Windows Server 2008) and apply\n>  it to my staging code.  The catch is: I cannot install git on the\n>  server to accept the patch.  Therefore, I would like to use a generic\n>  patching tool (such as patch from the GnuWin32 tools).  I tried\n>  generating a unified diff with the following command:\n>\n>  git diff -U > diff.patch\n>\n>  and then tried to apply it using:\n>\n>  patch -u -i ..\\other_dir\\diff.patch\n>\n>  and I got the error:\n>\n>  \"patch unexpectedly ends in middle of line\" ... \"Only garbage was\n>  found in the patch input\"\n>\n>  It might be a problem with how I'm using patch, and if so, forgive\n>  me.  If not, then how can I generate a generic diff format from git so\n>  I can do what I want?\n>\n>  Thanks all!\n>  Joe Fiorini\n\nJust a guess, but the gnuwin32 tools might not like unix line endings.\nTry opening and re-saving in wordpad (or vim :set ff=dos, or $insert\nyour favorite method here).\n"},{"id":"73062","messageId":"09409F50-D3C4-4290-AF94-C8985E7A52C8@faithfulgeek.org","threadId":"12858","inReplyTo":"3e8340490803251141x6d199d8ch8828b396da202d81@mail.gmail.com","subject":"Re: Apply patch on server w/o git","fromName":"Joe Fiorini","fromEmail":"joe@faithfulgeek.org","sentAt":"2008-03-25T19:23:23Z","receivedAt":"2008-03-25T19:23:23Z","isPatch":false,"sender":{"key":"joe@faithfulgeek.org","avatar":null},"body":"I just tried it and no luck.  Anyone have any other ideas?\n\n-Joe\n\nOn Mar 25, 2008, at 2:41 PM, Bryan Donlan wrote:\n\n> On Tue, Mar 25, 2008 at 2:25 PM, Joe Fiorini <joe@faithfulgeek.org>  \n> wrote:\n>> I am trying to generate a diff patch on my local dev box.  I want to\n>> upload this patch to a server (running Windows Server 2008) and apply\n>> it to my staging code.  The catch is: I cannot install git on the\n>> server to accept the patch.  Therefore, I would like to use a generic\n>> patching tool (such as patch from the GnuWin32 tools).  I tried\n>> generating a unified diff with the following command:\n>>\n>> git diff -U > diff.patch\n>>\n>> and then tried to apply it using:\n>>\n>> patch -u -i ..\\other_dir\\diff.patch\n>>\n>> and I got the error:\n>>\n>> \"patch unexpectedly ends in middle of line\" ... \"Only garbage was\n>> found in the patch input\"\n>>\n>> It might be a problem with how I'm using patch, and if so, forgive\n>> me.  If not, then how can I generate a generic diff format from git  \n>> so\n>> I can do what I want?\n>>\n>> Thanks all!\n>> Joe Fiorini\n>\n> Just a guess, but the gnuwin32 tools might not like unix line endings.\n> Try opening and re-saving in wordpad (or vim :set ff=dos, or $insert\n> your favorite method here).\n"},{"id":"73065","messageId":"20080325194631.GD4857@efreet.light.src","threadId":"12858","inReplyTo":"3e8340490803251141x6d199d8ch8828b396da202d81@mail.gmail.com","subject":"Re: Apply patch on server w/o git","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2008-03-25T19:46:31Z","receivedAt":"2008-03-25T19:46:31Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Tue, Mar 25, 2008 at 14:41:04 -0400, Bryan Donlan wrote:\n> Just a guess, but the gnuwin32 tools might not like unix line endings.\n> Try opening and re-saving in wordpad (or vim :set ff=dos, or $insert\n> your favorite method here).\n\nThat won't actually work! The problem is, that:\n - The headers (+++/---/@@ lines) should have dos line endings (but does not\n   matter too much).\n - The bodies must have the same line endings the actual code does.\n\nQuestion is, what the code has (it could have been transfered by some method\nthat converted the line-endings or something).\n\nAlso trying to patch with ignoring whitespace could work (I believe I did\nthat the other way 'round -- applying windowsy newline-damaged patch on\nunix). And if it does not, it's not the newlines problem.\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"},{"id":"73068","messageId":"200803252057.38326.robin.rosenberg.lists@dewire.com","threadId":"12858","inReplyTo":"CA08AA77-A9EA-4490-B1BE-25E8B7402290@faithfulgeek.org","subject":"Re: Apply patch on server w/o git","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-03-25T19:57:38Z","receivedAt":"2008-03-25T19:57:38Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Den Tuesday 25 March 2008 19.25.58 skrev Joe Fiorini:\n> I am trying to generate a diff patch on my local dev box.  I want to\n> upload this patch to a server (running Windows Server 2008) and apply\n> it to my staging code.  The catch is: I cannot install git on the\n> server to accept the patch.  Therefore, I would like to use a generic\n> patching tool (such as patch from the GnuWin32 tools).  I tried\n> generating a unified diff with the following command:\n>\n> git diff -U > diff.patch\n>\n> and then tried to apply it using:\n>\n> patch -u -i ..\\other_dir\\diff.patch\n\nYou can try git-apply instead of patch. It is a bit smarter (and not\noutsmarting itself either).\n\n-- robin\n"},{"id":"73100","messageId":"323B72DF-3387-40ED-8235-213A9FAD6CDD@faithfulgeek.org","threadId":"12858","inReplyTo":"200803252057.38326.robin.rosenberg.lists@dewire.com","subject":"Re: Apply patch on server w/o git","fromName":"Joe Fiorini","fromEmail":"joe@faithfulgeek.org","sentAt":"2008-03-26T03:03:58Z","receivedAt":"2008-03-26T03:03:58Z","isPatch":false,"sender":{"key":"joe@faithfulgeek.org","avatar":null},"body":"Thanks for all your replies.  Unfortunately, I cannot use git apply  \nbecause I will not have access to git on the server where I'm doing  \nthe patch.  I will try Jan's suggestion of ignoring whitespace.\n\n-Joe\n\nOn Mar 25, 2008, at 3:57 PM, Robin Rosenberg wrote:\n\n> Den Tuesday 25 March 2008 19.25.58 skrev Joe Fiorini:\n>> I am trying to generate a diff patch on my local dev box.  I want to\n>> upload this patch to a server (running Windows Server 2008) and apply\n>> it to my staging code.  The catch is: I cannot install git on the\n>> server to accept the patch.  Therefore, I would like to use a generic\n>> patching tool (such as patch from the GnuWin32 tools).  I tried\n>> generating a unified diff with the following command:\n>>\n>> git diff -U > diff.patch\n>>\n>> and then tried to apply it using:\n>>\n>> patch -u -i ..\\other_dir\\diff.patch\n>\n> You can try git-apply instead of patch. It is a bit smarter (and not\n> outsmarting itself either).\n>\n> -- robin\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"73329","messageId":"20080329184606.GB4920@efreet.light.src","threadId":"12858","inReplyTo":"323B72DF-3387-40ED-8235-213A9FAD6CDD@faithfulgeek.org","subject":"Re: Apply patch on server w/o git","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2008-03-29T18:46:06Z","receivedAt":"2008-03-29T18:46:06Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Tue, Mar 25, 2008 at 23:03:58 -0400, Joe Fiorini wrote:\n> Thanks for all your replies.  Unfortunately, I cannot use git apply  \n> because I will not have access to git on the server where I'm doing the \n> patch.  I will try Jan's suggestion of ignoring whitespace.\n\nBy the way, why *can't* you use git there? There is win32 build of git\n(http://code.google.com/p/msysgit/) and if you can't get the repository over\n(but if you can get anything there, you should be able to get bundles there\ntoo), you can still use git-apply, since it can work without a repository as\na pure patch replacement.\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"}]}