all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Reiner Steib <reiner.steib@gmx.de>
Cc: 4451@emacsbugs.donarmstrong.com
Subject: bug#4451: 23.1; EOL problems with vc-diff and cygwin
Date: Mon, 05 Oct 2009 22:58:40 +0200	[thread overview]
Message-ID: <83fx9xo8vz.fsf@gnu.org> (raw)
In-Reply-To: <20091005180753.1mcmt2jzswoko048@imap.uni-ulm.de>

> Date: Mon, 05 Oct 2009 18:07:53 +0200
> From: Reiner Steib <reiner.steib@gmx.de>
> Cc: 4451@emacsbugs.donarmstrong.com, monnier@iro.umontreal.ca
> 
> The repository file (K3.xml,v) has Unix EOLs.  But if I do a fresh
> checkout, I get a file K3.xml with DOS EOLs (I think this is the usual
> behavoir of the Windows cvs binaries[1] for text files unless you
> specify the switch "-ko").

Yes, that's normal behavior of the ported CVS.

> However, in my workflow I overwrite the file with a Unix EOL file
> (exported from some application)

Why are you doing that, and what is that ``some application'' which
converts the DOS EOLs into Unix?

> Probably this conversion is also the reason that "cvs diff --binary"
> outputs "^M^M$" for the old file and "^M$" for the new file.  "cvs diff"
> outputs consitent DOS EOLs (both diff markers and the text):
> 
> $ cvs diff SK3.xml | cat --show-all | grep -F -v '^M' | wc -l

It sounds like your port of CVS assumes that text files have DOS
EOLs.  If you violate that assumption, it produces badly formatted
files, as far as EOL is concerned, and all hell will break loose on
you; Emacs showing the ugly ^M characters is just one of the
symptoms.

> > Another possibility is that somewhere along the chain of processing
> > the output, we force EOL conversion to be Unix-style, instead of
> > detecting EOLs dynamically, or maybe even forcing it to DOS (if we
> > have clear evidence for doing the latter).
> 
> `vc-coding-system-for-diff' returns `utf-8-unix' in both calls.

Because the file is already visited in an Emacs buffer, I presume, and
vc-coding-system-for-diff uses that.

So I agree with Stefan that you should simply not overwrite the
checked-out file with Unix EOLs.  We could install the change
suggested by Stefan (based on this analysis, I no longer object to
it), but I'm quite sure this won't be the end of your trouble.  For
example, Patch will most probably fail to apply the diffs, because
they have DOS EOLs while the source file has Unix EOLs.  This means
that CVS merges will also fail.  Etc., etc. -- that way lies madness.

If you really want Unix EOLs, you will have to hack CVS to use binary
I/O.  (I think you can force that by using some special Cygwin options
when ``mounting'' the volume, but don't ask me for details, because I
don't use Cygwin.)

Thanks.





  parent reply	other threads:[~2009-10-05 20:58 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-16 18:08 bug#4451: 23.1; EOL problems with vc-diff and cygwin Reiner Steib
2009-09-16 20:56 ` Eli Zaretskii
2009-09-17 14:26   ` Reiner Steib
2009-09-17 16:35     ` Stefan Monnier
2009-09-17 17:22       ` Eli Zaretskii
2009-09-17 20:59         ` Stefan Monnier
2009-09-18 11:29       ` Reiner Steib
2009-09-24 17:00         ` Reiner Steib
2009-09-24 22:07           ` Stefan Monnier
2009-09-25 19:11             ` Eli Zaretskii
2009-09-26  8:27               ` Reiner Steib
2009-09-26  9:20                 ` Eli Zaretskii
2009-09-27  0:36                   ` Stefan Monnier
2009-09-27  7:38                     ` Eli Zaretskii
2009-09-27 19:03                       ` Stefan Monnier
2009-09-27 20:35                         ` Reiner Steib
2009-09-28  1:08                           ` Stefan Monnier
2009-10-05 16:07                   ` Reiner Steib
2009-10-05 18:45                     ` Stefan Monnier
2009-10-05 20:58                     ` Eli Zaretskii [this message]
2010-07-15  7:22                       ` Reiner Steib
2010-07-15  8:33                         ` Eli Zaretskii
2010-07-16  6:51                           ` Reiner Steib
2010-07-16  8:05                             ` Andreas Schwab
2010-07-16 10:18                             ` Eli Zaretskii
2010-07-19  7:23                               ` Reiner Steib
2009-09-17 17:18     ` Eli Zaretskii
2009-09-18 11:31       ` Reiner Steib

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83fx9xo8vz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=4451@emacsbugs.donarmstrong.com \
    --cc=reiner.steib@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.