info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checkout from a Linux-based repository with DOS line-endings


From: Spiro Trikaliotis
Subject: Re: Checkout from a Linux-based repository with DOS line-endings
Date: Wed, 19 May 2004 09:07:30 +0200
User-agent: Mutt/1.5.6i

Hello Marko,

* On Tue, May 18, 2004 at 01:34:00PM +0200 marko wrote:

> Well, but, perhaps I misunderstand you, I do cross that border!

Yes, you do, and I'm aware of this. ;-)

> And that's the trouble. My repository (created and maintained on
> linux' cvs) uses LF, but I'd like to check the source out in CR+LF,
> which obviously doesn't work so easily... Need to try what Doug
> recommended. Let WinCVS work on a copy of the repository directly and
> hope it would take care of the LF->CR+LF conversion.

Why not use cygwin? Don't you have access to the repository through
cygwin? I use it myself, and the only problems I'm having with this is
when there are Directories in the repository which differ only in case,
that it, something like foo/ and Foo/.


Another option I see, which requires a little bit of work by hand:

1. Checkout a new working copy on Linux, which you take home.

2. Make a copy of that working copy, in a new directory, so you have two
   versions. I'll name the two directories cvs.comp/ and cvs.work/ in
   the sequel.
   
3. Make sure you don't touch cvs.comp/ in any way. Do all your work in
   cvs.work/ !
   
4. Editing files in cvs.work/ should work with most Windows editors, as
   most ones can handle LF as well as CR/LF, but they store only in
   CR/LF format. This does not apply to Notepad ("Editor") in
   NT/2000/XP; if you want to use that, make sure you convert your files
   to CR/LF before (for example, with the help of WordPad, or unix2dos
   from cygwin).
   
5. If you've done all your work, there comes the tricky part:
   a. make a diff through your two directories:
      $ diff -urN cvs.comp/ cvs.work/ > diff-file
      (this has to be a Unix-style diff, for example, from Cygwin. Do
      not use the diff from Windows, as that tools is totally different)
   b. Now, convert that diff-file to back to Unix format:
      $ dos2unix diff-file
      (if dos2unix is installed on your Windows box, for example, from
      Cygwin. If not, perform this step back at work, on your Linux
      machine where this is hopefully installed, just before applying
      the patch command from step 6)
   c. carry the diff-file back to work.

   I would even suggest you take cvs.comp/ and cvs.work/ with you, in
   case something goes wrong and you have to apply some changes
   manually (something which was never necessary for me).
   
6. Back at work (Linux), apply that diff-file to your checked-out
   working copy (which you created at 1):
   $ patch -p1 < diff-file
   
7. Now, your working copy at work is synchronized with your working copy
   at home, and you can do what you are used to do.

One note: This does not work if you have binary files in the repository,
as diff does not handle binary files. Anyway, since it's not a good idea
to store binaries under cvs control in most cases, this should not be a
problem. If it is, just make copies of them and apply them manually in
step 6.

I've done something very similar before, so I know it works (if I did
not forget something important in my explanation).

HTH,
   Spiro.

-- 
Spiro R. Trikaliotis         I'm subscribed to the mailing lists I'm posting,
http://www.trikaliotis.net/  so please refrain from Cc:ing me. Thank you.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]