* Apply patch on server w/o git
@ 2008-03-25 18:25 Joe Fiorini
2008-03-25 18:41 ` Bryan Donlan
2008-03-25 19:57 ` Robin Rosenberg
0 siblings, 2 replies; 7+ messages in thread
From: Joe Fiorini @ 2008-03-25 18:25 UTC (permalink / raw
To: git
I am trying to generate a diff patch on my local dev box. I want to
upload this patch to a server (running Windows Server 2008) and apply
it to my staging code. The catch is: I cannot install git on the
server to accept the patch. Therefore, I would like to use a generic
patching tool (such as patch from the GnuWin32 tools). I tried
generating a unified diff with the following command:
git diff -U > diff.patch
and then tried to apply it using:
patch -u -i ..\other_dir\diff.patch
and I got the error:
"patch unexpectedly ends in middle of line" ... "Only garbage was
found in the patch input"
It might be a problem with how I'm using patch, and if so, forgive
me. If not, then how can I generate a generic diff format from git so
I can do what I want?
Thanks all!
Joe Fiorini
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Apply patch on server w/o git
2008-03-25 18:25 Apply patch on server w/o git Joe Fiorini
@ 2008-03-25 18:41 ` Bryan Donlan
2008-03-25 19:23 ` Joe Fiorini
2008-03-25 19:46 ` Jan Hudec
2008-03-25 19:57 ` Robin Rosenberg
1 sibling, 2 replies; 7+ messages in thread
From: Bryan Donlan @ 2008-03-25 18:41 UTC (permalink / raw
To: Joe Fiorini; +Cc: git
On Tue, Mar 25, 2008 at 2:25 PM, Joe Fiorini <joe@faithfulgeek.org> wrote:
> I am trying to generate a diff patch on my local dev box. I want to
> upload this patch to a server (running Windows Server 2008) and apply
> it to my staging code. The catch is: I cannot install git on the
> server to accept the patch. Therefore, I would like to use a generic
> patching tool (such as patch from the GnuWin32 tools). I tried
> generating a unified diff with the following command:
>
> git diff -U > diff.patch
>
> and then tried to apply it using:
>
> patch -u -i ..\other_dir\diff.patch
>
> and I got the error:
>
> "patch unexpectedly ends in middle of line" ... "Only garbage was
> found in the patch input"
>
> It might be a problem with how I'm using patch, and if so, forgive
> me. If not, then how can I generate a generic diff format from git so
> I can do what I want?
>
> Thanks all!
> Joe Fiorini
Just a guess, but the gnuwin32 tools might not like unix line endings.
Try opening and re-saving in wordpad (or vim :set ff=dos, or $insert
your favorite method here).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Apply patch on server w/o git
2008-03-25 18:41 ` Bryan Donlan
@ 2008-03-25 19:23 ` Joe Fiorini
2008-03-25 19:46 ` Jan Hudec
1 sibling, 0 replies; 7+ messages in thread
From: Joe Fiorini @ 2008-03-25 19:23 UTC (permalink / raw
To: Bryan Donlan; +Cc: git
I just tried it and no luck. Anyone have any other ideas?
-Joe
On Mar 25, 2008, at 2:41 PM, Bryan Donlan wrote:
> On Tue, Mar 25, 2008 at 2:25 PM, Joe Fiorini <joe@faithfulgeek.org>
> wrote:
>> I am trying to generate a diff patch on my local dev box. I want to
>> upload this patch to a server (running Windows Server 2008) and apply
>> it to my staging code. The catch is: I cannot install git on the
>> server to accept the patch. Therefore, I would like to use a generic
>> patching tool (such as patch from the GnuWin32 tools). I tried
>> generating a unified diff with the following command:
>>
>> git diff -U > diff.patch
>>
>> and then tried to apply it using:
>>
>> patch -u -i ..\other_dir\diff.patch
>>
>> and I got the error:
>>
>> "patch unexpectedly ends in middle of line" ... "Only garbage was
>> found in the patch input"
>>
>> It might be a problem with how I'm using patch, and if so, forgive
>> me. If not, then how can I generate a generic diff format from git
>> so
>> I can do what I want?
>>
>> Thanks all!
>> Joe Fiorini
>
> Just a guess, but the gnuwin32 tools might not like unix line endings.
> Try opening and re-saving in wordpad (or vim :set ff=dos, or $insert
> your favorite method here).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Apply patch on server w/o git
2008-03-25 18:41 ` Bryan Donlan
2008-03-25 19:23 ` Joe Fiorini
@ 2008-03-25 19:46 ` Jan Hudec
1 sibling, 0 replies; 7+ messages in thread
From: Jan Hudec @ 2008-03-25 19:46 UTC (permalink / raw
To: Bryan Donlan; +Cc: Joe Fiorini, git
On Tue, Mar 25, 2008 at 14:41:04 -0400, Bryan Donlan wrote:
> Just a guess, but the gnuwin32 tools might not like unix line endings.
> Try opening and re-saving in wordpad (or vim :set ff=dos, or $insert
> your favorite method here).
That won't actually work! The problem is, that:
- The headers (+++/---/@@ lines) should have dos line endings (but does not
matter too much).
- The bodies must have the same line endings the actual code does.
Question is, what the code has (it could have been transfered by some method
that converted the line-endings or something).
Also trying to patch with ignoring whitespace could work (I believe I did
that the other way 'round -- applying windowsy newline-damaged patch on
unix). And if it does not, it's not the newlines problem.
--
Jan 'Bulb' Hudec <bulb@ucw.cz>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Apply patch on server w/o git
2008-03-25 18:25 Apply patch on server w/o git Joe Fiorini
2008-03-25 18:41 ` Bryan Donlan
@ 2008-03-25 19:57 ` Robin Rosenberg
2008-03-26 3:03 ` Joe Fiorini
1 sibling, 1 reply; 7+ messages in thread
From: Robin Rosenberg @ 2008-03-25 19:57 UTC (permalink / raw
To: Joe Fiorini; +Cc: git
Den Tuesday 25 March 2008 19.25.58 skrev Joe Fiorini:
> I am trying to generate a diff patch on my local dev box. I want to
> upload this patch to a server (running Windows Server 2008) and apply
> it to my staging code. The catch is: I cannot install git on the
> server to accept the patch. Therefore, I would like to use a generic
> patching tool (such as patch from the GnuWin32 tools). I tried
> generating a unified diff with the following command:
>
> git diff -U > diff.patch
>
> and then tried to apply it using:
>
> patch -u -i ..\other_dir\diff.patch
You can try git-apply instead of patch. It is a bit smarter (and not
outsmarting itself either).
-- robin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Apply patch on server w/o git
2008-03-25 19:57 ` Robin Rosenberg
@ 2008-03-26 3:03 ` Joe Fiorini
2008-03-29 18:46 ` Jan Hudec
0 siblings, 1 reply; 7+ messages in thread
From: Joe Fiorini @ 2008-03-26 3:03 UTC (permalink / raw
To: Robin Rosenberg; +Cc: git
Thanks for all your replies. Unfortunately, I cannot use git apply
because I will not have access to git on the server where I'm doing
the patch. I will try Jan's suggestion of ignoring whitespace.
-Joe
On Mar 25, 2008, at 3:57 PM, Robin Rosenberg wrote:
> Den Tuesday 25 March 2008 19.25.58 skrev Joe Fiorini:
>> I am trying to generate a diff patch on my local dev box. I want to
>> upload this patch to a server (running Windows Server 2008) and apply
>> it to my staging code. The catch is: I cannot install git on the
>> server to accept the patch. Therefore, I would like to use a generic
>> patching tool (such as patch from the GnuWin32 tools). I tried
>> generating a unified diff with the following command:
>>
>> git diff -U > diff.patch
>>
>> and then tried to apply it using:
>>
>> patch -u -i ..\other_dir\diff.patch
>
> You can try git-apply instead of patch. It is a bit smarter (and not
> outsmarting itself either).
>
> -- robin
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Apply patch on server w/o git
2008-03-26 3:03 ` Joe Fiorini
@ 2008-03-29 18:46 ` Jan Hudec
0 siblings, 0 replies; 7+ messages in thread
From: Jan Hudec @ 2008-03-29 18:46 UTC (permalink / raw
To: Joe Fiorini; +Cc: Robin Rosenberg, git
On Tue, Mar 25, 2008 at 23:03:58 -0400, Joe Fiorini wrote:
> Thanks for all your replies. Unfortunately, I cannot use git apply
> because I will not have access to git on the server where I'm doing the
> patch. I will try Jan's suggestion of ignoring whitespace.
By the way, why *can't* you use git there? There is win32 build of git
(http://code.google.com/p/msysgit/) and if you can't get the repository over
(but if you can get anything there, you should be able to get bundles there
too), you can still use git-apply, since it can work without a repository as
a pure patch replacement.
--
Jan 'Bulb' Hudec <bulb@ucw.cz>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-03-29 18:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-25 18:25 Apply patch on server w/o git Joe Fiorini
2008-03-25 18:41 ` Bryan Donlan
2008-03-25 19:23 ` Joe Fiorini
2008-03-25 19:46 ` Jan Hudec
2008-03-25 19:57 ` Robin Rosenberg
2008-03-26 3:03 ` Joe Fiorini
2008-03-29 18:46 ` Jan Hudec
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).