Using dos2unix on commit???

2003-06-13 Thread Andy Kriger
I am trying to setup our Unix-based CVS repository to run dos2unix when
files are committed, but I'm not having much luck and don't see any solution
laid out clearly in the mailing lists.

I have a commitinfo file...
DEFAULT dos2unix

When I commit my Windows text file...
~/webapps cvs ci -m  wintext.txt
dos2unix: converting file /usr/local/cvsroot/webapps to UNIX format ...
dos2unix: problems converting file /usr/local/cvsroot/webapps

Reading the CVS docs...
The full path to the current source repository is appended to the template,
followed by the file names of any files involved in the commit (added,
removed, and modified files).

So I thought that dos2unix would get the path combined with filename as an
argument. Apparently this isn't so. Does anyone have an example of this that
does work?

thx
andy kriger



___
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs


Re: Using dos2unix on commit???

2003-06-13 Thread Kaz Kylheku
On Fri, 13 Jun 2003, Andy Kriger wrote:

 I am trying to setup our Unix-based CVS repository to run dos2unix when
 files are committed, but I'm not having much luck and don't see any solution
 laid out clearly in the mailing lists.

CVS in client-server mode already performs the conversions.

(You aren't doing anything silly, like mounting the repository as a
filesystem over the network?)



___
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs


Re: Using dos2unix on commit???

2003-06-13 Thread Frederic Brehm
At 11:47 AM 6/13/2003, Andy Kriger wrote:
I am trying to setup our Unix-based CVS repository to run dos2unix when
files are committed, but I'm not having much luck and don't see any solution
laid out clearly in the mailing lists.
Don't attempt to use a commitinfo script to change a file being checked in. 
It won't work.


So I thought that dos2unix would get the path combined with filename as an
argument.
man dos2unix


Does anyone have an example of this that does work?


Sorry, no. Here's some suggestions, though.

1. Write a script that greps for CRLF in a file. Print an informative error 
message telling the user to run dos2unix on the offending files, and then 
have the script return false (not zero). Use this script in commitinfo. You 
will have to read the documentation about commitinfo again CAREFULLY 
because the arguments passed to the script are not what you think. Use 
DEFAULT echo to experiment, and be sure to cvs add a new directory when 
you experiment.

2. If you are checking in from Windows, then use the correct cvs client. If 
you are using Cygwin with the default text type of Unix, then you will 
have to use a different cvs client.

Fred

___
Frederic W. Brehm, Sarnoff Corporation, http://www.sarnoff.com/


___
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs


RE: Using dos2unix on commit???

2003-06-13 Thread Andy Kriger
Thanks for the suggestions. I'll try those ideas.

As background, what is prompting this need is multiple developers with
different IDEs making connections to CVS. Since there's no way to be sure
what line format is being used, I'm looking for consistency.

-Original Message-
From: Frederic Brehm [mailto:[EMAIL PROTECTED]
Sent: Friday, June 13, 2003 13:38
To: Andy Kriger; [EMAIL PROTECTED]
Subject: Re: Using dos2unix on commit???


At 11:47 AM 6/13/2003, Andy Kriger wrote:
I am trying to setup our Unix-based CVS repository to run dos2unix when
files are committed, but I'm not having much luck and don't see any
solution
laid out clearly in the mailing lists.

Don't attempt to use a commitinfo script to change a file being checked in.
It won't work.


So I thought that dos2unix would get the path combined with filename as an
argument.

man dos2unix


Does anyone have an example of this that does work?


Sorry, no. Here's some suggestions, though.

1. Write a script that greps for CRLF in a file. Print an informative error
message telling the user to run dos2unix on the offending files, and then
have the script return false (not zero). Use this script in commitinfo. You
will have to read the documentation about commitinfo again CAREFULLY
because the arguments passed to the script are not what you think. Use
DEFAULT echo to experiment, and be sure to cvs add a new directory when
you experiment.

2. If you are checking in from Windows, then use the correct cvs client. If
you are using Cygwin with the default text type of Unix, then you will
have to use a different cvs client.


Fred

___
Frederic W. Brehm, Sarnoff Corporation, http://www.sarnoff.com/



___
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs


RE: Using dos2unix on commit???

2003-06-13 Thread Frederic Brehm
At 03:25 PM 6/13/2003, Andy Kriger wrote:
As background, what is prompting this need is multiple developers with
different IDEs making connections to CVS. Since there's no way to be sure
what line format is being used, I'm looking for consistency.
Good luck.

The way to decrease the chances of line ending problems is to use a CVS 
client that always uses the local system native text format.

All editors that I am familiar with that are multilingual with respect to 
line ending formats will preserve the original format of the file by 
default. A reasonable IDE will create text files in the local system native 
format. If an IDE gives you a choice for line endings, always choose the 
local system native format.

Watch out for users who checkout on one system and edit the files on 
another system using a cross-mounted file system.

Also watch out for editors or IDE's that insist on doing text the one true 
way that's different from the local system native format. I can't think of 
any of those, but maybe you know of some.

Fred

___
Frederic W. Brehm, Sarnoff Corporation, http://www.sarnoff.com/


___
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs


Re: Using dos2unix on commit???

2003-06-13 Thread Larry Jones
Andy Kriger writes:
 
 As background, what is prompting this need is multiple developers with
 different IDEs making connections to CVS. Since there's no way to be sure
 what line format is being used, I'm looking for consistency.

You've got hold of the wrong end of the stick.  It is the responsibility
of the CVS client to convert between the host's line ending conventions
and the CVS client/server protocol's convention.  If you have clients
that do not do that, reconfigure them correctly.  If that's not
possible, get rid of them -- there's no sense struggling with a
defective client when there are lots of correct ones to choose from.

-Larry Jones

Archaeologists have the most mind-numbing job on the planet. -- Calvin


___
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs


Re: Using dos2unix on commit???

2003-06-13 Thread mike walster
Ok sorry for the screwed up emails I have been sending around, I might
have this one addressed correctly :-)

Most of the info here has already been mentioned, a small part that
we experienced has been left out. The cygwin cvs client does not
fix up the line endings on the commit. At least the version that we
are using. We have found the files created on windows with say Gvim
when it was launched from windows by default creates dos style line
endings. However the same program when launched from cygwin on the 
same machine creates unix style line endings. The cygwin envinronments
are installed with unix style the default for that system. I have not
experimented with it otherwise and don't know how it acts. We found
that a file saved from a unix environment checked out with cywin and
edited with gvim launched from windows then checked in with cygwin
has screwed up line endings. This was causing merges to panick on a
regular basis which was really ticking off one of our remote developers,
who was having difficulty with the cvs paradigm to begin with. We found
that files checked out with cygwin and edited with vim from cygwin
were ok. Creating a new file on windows with Gvim caused the line ending
foul up. Basically we just don't use cvs that comes with cygwin and we
don't have any difficulties with any editors. We could get the cvs that
comes with cygwin to work fine but one really has to pay attention to 
what is going on. I develop on linux all the time and on windows only when
I am doing something windows specific. The rest my shop is on windows, while
I was comfortable with the line ending stuff it caused a great deal
of confusion for many of our developers. We really had TWO things going
on one was the cvs client the other was what environment we launched
various editors from. Excuse the length I hope that this is at least
somewhat helpful to someone.
mw-

--- Andy Kriger [EMAIL PROTECTED] wrote:
 I am trying to setup our Unix-based CVS repository to run dos2unix when
 files are committed, but I'm not having much luck and don't see any solution
 laid out clearly in the mailing lists.
 
 I have a commitinfo file...
 DEFAULT dos2unix
 
 When I commit my Windows text file...
 ~/webapps cvs ci -m  wintext.txt
 dos2unix: converting file /usr/local/cvsroot/webapps to UNIX format ...
 dos2unix: problems converting file /usr/local/cvsroot/webapps
 
 Reading the CVS docs...
 The full path to the current source repository is appended to the template,
 followed by the file names of any files involved in the commit (added,
 removed, and modified files).
 
 So I thought that dos2unix would get the path combined with filename as an
 argument. Apparently this isn't so. Does anyone have an example of this that
 does work?
 
 thx
 andy kriger
 
 
 
 ___
 Info-cvs mailing list
 [EMAIL PROTECTED]
 http://mail.gnu.org/mailman/listinfo/info-cvs



___
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs


Re: Using dos2unix on commit???

2003-06-13 Thread Larry Jones
mike walster writes:
 
 The cygwin envinronments
 are installed with unix style the default for that system.

That is the root of your problem.  You should *NEVER* install cygwin
with Unix line endings -- if you want a Unix-like system, you know where
to find it.  Having some of your tools use one line-ending convention
and others another is a sure recipe for insanity, catastrophe, or both.

 We found
 that a file saved from a unix environment checked out with cywin and
 edited with gvim launched from windows then checked in with cygwin
 has screwed up line endings. This was causing merges to panick on a
 regular basis which was really ticking off one of our remote developers,

What do you mean by causing merges to panick?  I can see causing the
developer to panic since the entire file will be completely different
from CVS's perspective, but CVS shouldn't have a problem with it.

-Larry Jones

Just when I thought this junk was beginning to make sense. -- Calvin


___
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs


Re: Using dos2unix on commit???

2003-06-13 Thread Eric Siegerman
On Fri, Jun 13, 2003 at 06:01:18PM -0400, Larry Jones wrote:
 What do you mean by [line-ending problems] causing merges to panick?  I can see 
 causing the
 developer to panic since the entire file will be completely different
 from CVS's perspective, but CVS shouldn't have a problem with it.

I suspect he was using panic in the mundane, informal sense of
freak out, not the jargony sense of abort.

--

|  | /\
|-_|/ Eric Siegerman, Toronto, Ont.[EMAIL PROTECTED]
|  |  /
When I came back around from the dark side, there in front of me would
be the landing area where the crew was, and the Earth, all in the view
of my window. I couldn't help but think that there in front of me was
all of humanity, except me.
- Michael Collins, Apollo 11 Command Module Pilot



___
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs


Re: Using dos2unix on commit???

2003-06-13 Thread mike walster
One must be carefull about the words one chooses here
I did indeed use the term panick spelled with a ck loosley.

The files do show up completely different which was causing
the developer to panick somewhat.
As I recall the instructions for cygwin say to always install
as unix line endings. I could be mistaken however. We installed
cygwin to use ssh not cvs particulary, that is just something
that came up later...
mw- 

--- Larry Jones [EMAIL PROTECTED] wrote:
 mike walster writes:
  
  The cygwin envinronments
  are installed with unix style the default for that system.
 
 That is the root of your problem.  You should *NEVER* install cygwin
 with Unix line endings -- if you want a Unix-like system, you know where
 to find it.  Having some of your tools use one line-ending convention
 and others another is a sure recipe for insanity, catastrophe, or both.
 
  We found
  that a file saved from a unix environment checked out with cywin and
  edited with gvim launched from windows then checked in with cygwin
  has screwed up line endings. This was causing merges to panick on a
  regular basis which was really ticking off one of our remote developers,
 
 What do you mean by causing merges to panick?  I can see causing the
 developer to panic since the entire file will be completely different
 from CVS's perspective, but CVS shouldn't have a problem with it.
 
 -Larry Jones
 
 Just when I thought this junk was beginning to make sense. -- Calvin



___
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs