[BUG]DVS breaks FileContentsBrowser diffing

Julian Fitzell julian at beta4.com
Fri Jun 27 20:12:24 UTC 2003


Daniel Vainsencher wrote:
> AFAIU, the Avi's whole reason for the DVS and friends adventure is that
> he has no CVS-or-better in Squeak. My understanding is that but for CVS,
> we would not be discussing this issue considering that Squeak has
> editors with search. And Monticello has had a working 3-way diff (I
> don't know it's status), so I'm not sure I understand the "requiring
> special tools" part. What more (other than a CVS) does one need beyond
> existing Squeak tools?

DVS was designed to work with CVS (thus the name).  Monticello was 
originally developed not to.  We eventually realized that nobody wanted 
to trust their code to a new untested versioning system, so Avi 
abstracted Monticello a bit so we could work on the model while still 
storing the data in CVS (Where you can see it on a regular basis and 
know that it is still there).

Now that we've done that, work is progressing on a way to do away with 
CVS altogether - but it's still nice to be able to work with it and I 
don't think it's too hard (aside from the DVS issue of using the 
standard .st file format, which Monticello avoids).

> Anyway, assuming that you want to be using existing tools, note that the
> correct strategy to use is still dependent on your specific tools (which
> change from person to person), and the "use platform line endings", as
> CVS requires, won't always be correct. For example, my main editor other
> than Squeak is EMACS, which is perfectly happy to Mac or Dos mode line
> endings, however it received them.

I agree that you can't always use platform line endings, which is why I 
insisted that Monticello keep the line ending format of the file when 
filing back out (I personally work on windows sometimes with a lot of 
files mounted from linux over Samba, so they need to keep getting filed 
out with LF line endings so CVS is happy).

> Looking at the elegance with which emacs deals with line endings, by
> simply entering an application mode depending on the file contents
> awakens my old uneasiness about CrLfStreams - formats to save things in
> should be an application level decision. Infrastructure classes such as

Actually, line endings *should* be a system-level decision, not an 
application level one.  When you run an application on a system it 
should use whatever that system uses to denote the end of a line in a 
text file.  When you copy a file between systems or open it over the 
network, the line endings should be translated.  Unfortunately, this 
can't work unless the system knows that the file is a text file (and no 
system I know of really marks that off in any _guaranteed_ way).

Luckily, however, it's incredibly easy to load files with different line 
endings (so easy that if every application just did that, we wouldn't 
have this problem anymore).  But emacs, in my opinion, takes the correct 
approach which is to load the file no matter what and then keep the line 
endings the same.  There's nothing I hate more than editors that change 
my line endings when I save.

There is no good reason, in my opinion, why Squeak shouldn't be able to 
load code with any line ending format as well.

> streams should not be making these decisions. Think about it like this -
> if the decision is made by the application, then the user/application
> programmer can elaborate behavior according to application level
> criteria (code in this project should be saved in this format).
> Mechanisms shouldn't dictate policy.

Well, you need CrLfFileStream because it enables people to transparently 
load files with all line endings.  Then you should be able to select a 
class (or set a property on a class) based on whether you want to use a 
particular line ending, native line ending, or keep the line endings the 
same.

> In fact, I'd remove CrLfStream from the image, just to prevent people
> from going down this path unless they really understand the consequences
> (as someone that used to have it as his ConcreteFileStreamClass, and
> found his email archives between a PC and a Linux incompatible...).

Ew.. don't take away something just because you can hurt yourself with 
it.  That's hardly the philosophy of Squeak (sounds like Java to me). 
Documentation and education would be a better option (Squeak programmers 
are pretty smart generally) and making everything in the image work 
better with varied line endings would be even better.

Julian (so tired of line ending discussions this week :-/ )




More information about the Squeak-dev mailing list