[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Idea for dealing with text-file line endings

From: Tim Peters <tim_at_zope.com>
Date: 2004-04-30 17:52:36 CEST

[Ben Collins-Sussman]
> ...
> Once in a while, one of us forgets to set native eol style on a
> new file. When that happens, it's discovered pretty quickly (easy
> to spot!), and fixed pretty quickly as well. It's not a huge deal.

Please help me understand exactly what it takes "to fix" one of these?

These are my guesses:

1. A Linux user adds a new text file and forgets to set eol-style.

   Anyone can fix it by setting the eol-style property after the
   fact.

   If someone on Windows managed to get the \n style before eol-style
   was changed, what happens?

   A. Their working copy is out of date, and their next update
      will automatically repair it.

   - or -

   B. Their working copy isn't considered to be out of date, and
      they'll continue to have "the wrong" line ends until they
      remove their working copy and update (this is akin to what
      happens to Windows users under CVS for *binary* files that
      weren't fiddled with -kb: anyone can "cvs admin -kb" to
      repair that after the fact, but the Windows user continues
      to have a corrupted file because cvs up doesn't consider their
      damaged copy to be out of date).

2. A Windows user adds a new text file (with \r\n line ends)
   and forgets to set eol-style. (I expect this one will be much
   more common in Zope projects than in Subversion development.)

   The file in the repository has \r\n line ends then.

   Someone trys to repair this by setting eol-style.

   My guess \is "that's too late", because the file in the
   repository is already wrong, and merely setting a property
   after the fact won't change that. So I'm guessing:

   A. A Linux user who checks this out will continue to see \r\n.

   - and -

   B. A Windows user who checks this out will see \r\r\n (because
      the \n in the \r\n in the repository will get expanded to
      \r\n, and the \r in \r\n will come across unchanged).

How much of that is wrong?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Apr 30 18:17:12 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.