CVS question...

der.hans plug-discuss@lists.plug.phoenix.az.us
Fri, 8 Nov 2002 17:50:29 -0700 (MST)


Am 08. Nov, 2002 schw=E4tzte Liberty Young so:

>
> I hope this can be done...
>
> quickly:
> I need to _enforce_ dos end of line characters into files that are
> checked into a CVS tree.
>
> Background (long version):
>
> Here at work, we do both dos and linux work, and i'm trying to put all
> of our code, dos and linux, into a CVS repository. Problem is, that
> unless the End of Lines are terminated per dos standards, my co-workers
> Windows tools barf (win-cvs, along with some editor he uses).
> The biggest problem is that when he 'fixes' the problem created by me
> doing dos work from within linux, and he checks those files into CVS
> from his windows machine, CVS reports all lines as being diffed. They
> are, technically, they have different eol's.
>
> Now, i have a script that can do linux eol's into dos eol's, so that's
> no problem.
>
> The problem is that i'm not sure how to setup CVS so that when a file
> checked in (either before or after), it is ran through that script to
> convert any non-dos eol's into dos eol's.
>
> Anybody here have any ideas?

Look at dos2unix and unix2dos for your conversions. Easy to do with perl,
sed, etc., too.

Setup a wrapper on your client to call unix2dos whenever you check in dos
code.

Use cvs to do the wrapping:
       CVSROOT/commitinfo,v
              Records   programs   for   filtering  `cvs  commit'
              requests.

Oh, and the most obvious thing: stop using DOS ;-).

ciao,

der.hans
--=20
#  https://www.LuftHans.com/    http://www.TOLISGroup.com/
#  C'est la Net - der.hans