[p4] p4 diff2 and suppressing EOL differences

Smith, Jeff jsmith at medplus.com
Mon Jan 8 07:55:46 PST 2007


I've seen this problem and I think I know how it occurs.

It looks as though the LineEnding style win (and local on a Windows
machine) automatically converts a LF to a CR,LF pair.  This is a problem
if the file in the depot has a CR,LF in it already.  This can result in
a CR,CR,LF in the file when it is pulled down.  Give some strange client
sharing, it is even possible to get the CR,CR,LF back up into Perforce.

Ultimately, I think that the Perforce client shouldn't add a CR before
the LF if one is already there. 

Jeff

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Dave Lewis
Sent: Sunday, January 07, 2007 3:05 PM
To: Ivey, William
Cc: perforce-user at perforce.com
Subject: Re: [p4] p4 diff2 and suppressing EOL differences


On 1/7/07, Ivey, William <william_ivey at bmc.com> wrote:
> No, the EOLs on the server match whatever is submitted
> when the client's EOL option is "unix". Since we have

Yes,  they are kept in unix format on the server, and
converted to dos when the client is on a windows
machine.  Then submits of files with dos line endings
are converted back automatically to the std. unix
style on the server. ( when using the client default
for line endings)

Give this, I guess the unix line ending option basically
says that the server does no conversions.

But, like your experience, some files somehow
manage to get messed up.  I have never tracked
down the workflow that leads to this.  A number
of folks decided that things worked better with
the clients set to "share", and I didn't really
see any difference.


> a mixed shop, and most of our build is on unix, we set
> all clients to "unix" (we run cygwin on Windows in default EOL mode so

> it needs to see unix files too). The policy is that any file that is 
> not Windows-specific (such as a .bat file) must be unix-style.
>
> The problem is that some people's editors appear to be converting unix

> to dos by default. (Or in at least one case, the other way - oddly, 
> the same guy has managed to do both at times.)


I think if we fingured out how that happened, it would help
a lot!

But, as I said, we've never managed to actually determine
how it happens. Probably because you only notice it
after the fact.

dave

> So, a unix file is branched, gets edited and turned into
> a dos file, then submitted as such. Now p4 diff2 shows a content 
> difference. There is no line-by-line diff output if -dw is used so I 
> could analyze that, but it's tedious and makes the simple command line

> rather useless.
>
> -Wm
>
>
> > -----Original Message-----
> > From: Dave Lewis [mailto:dlewis78731 at gmail.com]
> > Sent: Saturday, January 06, 2007 9:49 AM
> > To: Ivey, William
> > Cc: perforce-user at perforce.com
> > Subject: Re: [p4] p4 diff2 and suppressing EOL differences
> >
> >
> > I *thought* that all text files were kept with the same line endings

> > in the depot, and line endings were adjusted when syncing to 
> > clients.
> >
> > So, there is usually no problem with diff2 unless line endings have 
> > gotten messed up in one of the files.
> >
> > I usually fix that when ever I find them.
> >
> > dave
> >
> >
> > On 1/5/07, Ivey, William <william_ivey at bmc.com> wrote:
> > > Has anyone found a way to get p4 diff2 to completely ignore end of

> > > line differences when comparing files?
> > >
> > > -db and -dw suppress the line-by-line diff, but it stil
> > says there is
> > > a content difference. (I don't really want to ignore all 
> > > whitespace, but I can live with that.)
> > >
> > > -Wm
> > >
> > > _______________________________________________
> > > perforce-user mailing list  -  perforce-user at perforce.com 
> > > http://maillist.perforce.com/mailman/listinfo/perforce-user
> > >
> >
> >
>
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com 
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user



More information about the perforce-user mailing list