* Re: Where is patch? - problems with patch.exe on w32
[not found] ` <43A07425.70205@student.lu.se>
@ 2005-12-14 20:04 ` Lennart Borgman
2005-12-15 4:26 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2005-12-14 20:04 UTC (permalink / raw)
I had some trouble with patch.exe on w32 from both Cygwin and GnuWin32
that I have asked about in a recent message here. The message below is
from my conversation on cygwin@cygwin.com about this. Corinna is one of
the maintainers.
The trouble I had turned out to be one with line endings. For some
reason patch does not behave as Emacs on w32 when it comes to line
endings. A line and should just be a line end in my opinion. The patched
text file should retain its original line format. If this is possible
then that would really give me and other using w32 a fair chance of
doing useful work. So I hope to get in contact with the patch maintainer
about this.
If it is not possible then I think Emacs on w32 should try to take care
of this. I guess this is possible, but I am not sure. It should simply
mean that Emacs should notice the line endings and then convert the
patch file to the same as those of the file to patch before doing the
patch. (But that is what I would like patch.exe to do instead.) Would
this be possible? I am speaking mostly about CR-LF about LF here. CR
could of course be another possibility, maybe other too. Suggestions?
----------------------------------------------------------------
Lennart Borgman wrote:
> Corinna Vinschen wrote:
>
>> On Dec 14 19:30, Lennart Borgman wrote:
>>
>>
>>> I am having trouble with patch. My Cygwin patch (and my GnuWin32
>>> patch) says it is version 2.5.9. But where is the sources for this?
>>> I looked at ftp://ftp.gnu.org/gnu/patch and they only have version
>>> 2.5.4. How can that be?
>>>
>>
>>
>> Cygwin patch is 2.5.8. The version is taken from some Linux distro, I
>> don't remember which one. The sources are where the binaries are, use
>> setup.exe to pull them on your machine. As for the upstream sources, I
>> have no idea. The bug report list is bug-gnu-utils AT gnu DOT org.
>>
>>
> Thanks for the information. It sounds a bit strange that the sources
> does not come from gnu.org however. Something seems to be wrong here.
> I have made a bcc of this message to bug-gnu-utils. I think the newest
> sources should be available at gnu.org and its mirrors.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Where is patch? - problems with patch.exe on w32
2005-12-14 20:04 ` Where is patch? - problems with patch.exe on w32 Lennart Borgman
@ 2005-12-15 4:26 ` Eli Zaretskii
2005-12-15 8:19 ` Lennart Borgman
0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2005-12-15 4:26 UTC (permalink / raw)
Cc: emacs-devel
> Date: Wed, 14 Dec 2005 21:04:19 +0100
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
>
> The trouble I had turned out to be one with line endings. For some
> reason patch does not behave as Emacs on w32 when it comes to line
> endings. A line and should just be a line end in my opinion. The patched
> text file should retain its original line format. If this is possible
> then that would really give me and other using w32 a fair chance of
> doing useful work. So I hope to get in contact with the patch maintainer
> about this.
I use the GnuWin32 port of Patch on Windows, and it works fine for me.
Since I checkout Emacs files with -kb option to "cvs up", they (the
text files in Emacs source tree) have Unix-style EOLs. Therefore, I
always invoke Patch with the --binary command-line option, which
causes Patch to preserve the Unix EOL format in the patched files.
Since Patch already knows how to detect DOS-style CR-LF EOLs in the
patch files and strip the CRs, this invocation method takes care of
all the problems with EOLs I ever had.
If I need to invoke Patch from within Emacs (e.g., if the patch was
sent in an email message), I do that with "C-x RET c Unix RET M-|",
which causes Emacs to pass the patch file to Patch with Unix EOLs.
These are all the tricks I need to get Patch DTRT on Windows. It
works perfectly.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Where is patch? - problems with patch.exe on w32
2005-12-15 4:26 ` Eli Zaretskii
@ 2005-12-15 8:19 ` Lennart Borgman
2005-12-15 19:26 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2005-12-15 8:19 UTC (permalink / raw)
Cc: emacs-devel
Eli Zaretskii wrote:
>>Date: Wed, 14 Dec 2005 21:04:19 +0100
>>From: Lennart Borgman <lennart.borgman.073@student.lu.se>
>>
>>The trouble I had turned out to be one with line endings. For some
>>reason patch does not behave as Emacs on w32 when it comes to line
>>endings. A line and should just be a line end in my opinion. The patched
>>text file should retain its original line format. If this is possible
>>then that would really give me and other using w32 a fair chance of
>>doing useful work. So I hope to get in contact with the patch maintainer
>>about this.
>>
>>
>
>I use the GnuWin32 port of Patch on Windows, and it works fine for me.
>Since I checkout Emacs files with -kb option to "cvs up", they (the
>text files in Emacs source tree) have Unix-style EOLs.
>
But I am just using the method for checkout that is shown on the
Savannah page. I think that should work. That is why I am suggesting
that patch should be a little bit more friendly.
Unfortunately I do not even understand exactly what you are doing.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Where is patch? - problems with patch.exe on w32
2005-12-15 8:19 ` Lennart Borgman
@ 2005-12-15 19:26 ` Eli Zaretskii
2005-12-15 20:19 ` Lennart Borgman
0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2005-12-15 19:26 UTC (permalink / raw)
Cc: emacs-devel
> Date: Thu, 15 Dec 2005 09:19:18 +0100
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> CC: emacs-devel@gnu.org
>
> >Since I checkout Emacs files with -kb option to "cvs up", they (the
> >text files in Emacs source tree) have Unix-style EOLs.
> >
> But I am just using the method for checkout that is shown on the
> Savannah page. I think that should work.
It works without using -kb as well, I just described what I do in my
setup. If your Emacs tree is checked-out without -kb, you don't need
to use the --binary option, that's the only change.
> Unfortunately I do not even understand exactly what you are doing.
Which part was not clear?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Where is patch? - problems with patch.exe on w32
2005-12-15 19:26 ` Eli Zaretskii
@ 2005-12-15 20:19 ` Lennart Borgman
2005-12-16 7:38 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2005-12-15 20:19 UTC (permalink / raw)
Cc: emacs-devel
Eli Zaretskii wrote:
>>>Since I checkout Emacs files with -kb option to "cvs up", they (the
>>>text files in Emacs source tree) have Unix-style EOLs.
>>>
>>>
>>>
>>But I am just using the method for checkout that is shown on the
>>Savannah page. I think that should work.
>>
>>
>
>It works without using -kb as well, I just described what I do in my
>setup. If your Emacs tree is checked-out without -kb, you don't need
>to use the --binary option, that's the only change.
>
>
I use the same command for update and initial checkout. Do you then add
-kb to the command described on Emacs home page at Savannah?
Since this procedure is not the standard procedure as far as I
understand I wonder if there are any more problems with doing so? What
about check ins? What about those part in the emacs/nt subdirectory?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Where is patch? - problems with patch.exe on w32
2005-12-15 20:19 ` Lennart Borgman
@ 2005-12-16 7:38 ` Eli Zaretskii
0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2005-12-16 7:38 UTC (permalink / raw)
Cc: emacs-devel
> Date: Thu, 15 Dec 2005 21:19:32 +0100
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> CC: emacs-devel@gnu.org
>
> I use the same command for update and initial checkout. Do you then add
> -kb to the command described on Emacs home page at Savannah?
Both "co" and "up" accept the -kb option. So just add -kb to these
two commands as described on the savannah page.
> Since this procedure is not the standard procedure as far as I
> understand I wonder if there are any more problems with doing so? What
> about check ins? What about those part in the emacs/nt subdirectory?
No problems at all, except that "cvs up" cannot patch files (because
they are treated as binary), so it downloads the whole files
downstream, which takes longer, especially with large files (such as
ChangeLog). Unless your connection is slow, this shouldn't matter
much, though.
Anyway, this has nothing to do with Patch; as I wrote patching Emacs
works even if you don't checkout with -kb. (And I think we are way
off topic on this list, anyway.)
^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <dnpsv8$o2r$1@sea.gmane.org>]
* Re: Where is patch?
[not found] ` <dnpsv8$o2r$1@sea.gmane.org>
@ 2005-12-14 20:28 ` Lennart Borgman
2005-12-15 4:29 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2005-12-14 20:28 UTC (permalink / raw)
Cc: cygwin, Emacs Devel
René Berber wrote:
>Lennart Borgman wrote:
>
>
>
>>I am having trouble with patch. My Cygwin patch (and my GnuWin32 patch)
>>says it is version 2.5.9. But where is the sources for this? I looked at
>>ftp://ftp.gnu.org/gnu/patch and they only have version 2.5.4. How can
>>that be?
>>
>>
>
>The latest GNU patch version compiles out of the box and it works better than
>the one distributed with Cygwin. By "works better" I mean that Cygwin's patch
>sometimes fail when GNU patch works perfect.
>
>
That is interesting. However my problem is with line endings. It turned
out that the file to patch has CR-LF line endings (which is ok) and the
patch file had LF line endings. This surprised me, I did not notice it
first. In my opinion it should not have had that. It came from
Thunderbird on MS Windows and I just pasted into a new file in Emacs.
Then Emacs made the decision to save the file with LF line endings.
There are two things I would like here:
*** For patch: I would like it to discover that the line ending type of
the patch file and the file to patch differ. I would then like patch to
convert the line endings in the patch read from the patch file to that
kind used in the file to patch. (It should not change the patch file of
course.) That would be enough to solve my problem. However I would like
such functionality to go into the main patch distribution if possible.
That would save work I hope.
*** For Emacs: I would like the default on MS Windows to be CR-LF line
endings. That would in my opinion be less surpricing for an MS Windows user.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Where is patch?
2005-12-14 20:28 ` Where is patch? Lennart Borgman
@ 2005-12-15 4:29 ` Eli Zaretskii
0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2005-12-15 4:29 UTC (permalink / raw)
Cc: r.berber, cygwin, emacs-devel
> Date: Wed, 14 Dec 2005 21:28:54 +0100
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> Cc: cygwin@cygwin.com, Emacs Devel <emacs-devel@gnu.org>
>
> *** For patch: I would like it to discover that the line ending type of
> the patch file and the file to patch differ.
Patch does that already if you use the --binary option on Windows.
> *** For Emacs: I would like the default on MS Windows to be CR-LF line
> endings. That would in my opinion be less surpricing for an MS Windows user.
We decided long ago to preserve the EOL format, and I think that
decision was correct. As I wrote elsewhere, I use Patch from within
Emacs on Windows with no problems at all. Emacs has commands to force
specific EOL types when it saves files and communicates with
subordinate programs, so the defaults are not really important.
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: Where is patch?
@ 2005-12-14 20:47 Richard Campbell
0 siblings, 0 replies; 9+ messages in thread
From: Richard Campbell @ 2005-12-14 20:47 UTC (permalink / raw)
> *** For Emacs: I would like the default on MS Windows to be CR-LF line endings. That would in my opinion be less surpricing for an MS Windows user.
1. My opinion is that \n line endings on Cygwin (a Unix-ish environment) are less surprising.
2. Cygwin already has a feature for determining line endings for files opened in text mode, and a corresponding install setting for the default (dos versus unix). If you wanted a default CR-LF ending out of Emacs, you could get it that way.
-Richard Campbell.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-12-16 7:38 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <43A064AD.4050604@student.lu.se>
[not found] ` <20051214192858.GM2399@calimero.vinschen.de>
[not found] ` <43A07425.70205@student.lu.se>
2005-12-14 20:04 ` Where is patch? - problems with patch.exe on w32 Lennart Borgman
2005-12-15 4:26 ` Eli Zaretskii
2005-12-15 8:19 ` Lennart Borgman
2005-12-15 19:26 ` Eli Zaretskii
2005-12-15 20:19 ` Lennart Borgman
2005-12-16 7:38 ` Eli Zaretskii
[not found] ` <dnpsv8$o2r$1@sea.gmane.org>
2005-12-14 20:28 ` Where is patch? Lennart Borgman
2005-12-15 4:29 ` Eli Zaretskii
2005-12-14 20:47 Richard Campbell
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.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).