Mail Archives: djgpp-workers/2000/12/17/05:41:52
> If a repository is on a Unix box, it means you need to write files in
> binary mode when checking them out.
Not if all files on it are simple sources; then using text mode would be
equally acceptable. It's basically the same situation as a local
repository, with a slightly better reason for using binary-only.
> > if, say, you checked out the CVS sources (in text mode,
> > so you end up with all CRLF). You edit some files, including the
> > MSVC project files. You make a diff, which would either use text mode or
> > binary mode.
> > If it used text mode, the patches to the project files would fail (as
> > they're CRLF in the repository). And if binary mode was used, you'd be
> > introducing CRLFs into the Unix-style sources.
>
> Sorry, I'm not following: in the scenario you described above, what
> did the user create the diffs for, and how are they relevant to the
> routine CVS operation?
The case in point would be me getting the sources from anonymous CVS.
I can't commit, so I need to prepare a diff to send to the maintainers.
If I changes DOS-style files too, my diff would need to be binary-based
to preserve EOL conventions in all files (since it would probably be
applied on a Linux/Unix box).
> If you are talking about the CVS client sending diffs to the server,
> then it should use the same logic as we talked before: read files in
> binary mode if that's the default, or in text mode if the user
> overrides the default. If the local CVS tree is kept in
> Unix-compatible format (which I think should be the default for remote
> repositories), then binary reads for computing diffs will always DTRT.
I know - I wasn't talking about internal CVS operations, but rather about
using CVS-created diffs.
> > Unless I'm mistaken about how patch --binary operates, it would not help
> > in this case
> I thought you were talking about Patch invoked locally, not on the
> remote server. Are you?
I was indeed talking about invoking GNU patch on a diff created by CVS.
I'll be testing all-binary operation this week (if I find the time); if
that seems to work, I'll try adding the two other modes of operation and
see how they fare.
I was thinking of using the same options as WinCVS does (--lf and --crlf),
but what would be a good name for the mod DJ suggested (binary write,
text read)? --maybe-crlf?
- Raw text -