Re: End-of-line style plugin

2008-01-23 Thread Antonio Petrelli
2008/1/23, John Coleman [EMAIL PROTECTED]:

 I quickly threw together an end-of-line style plugin yesterday becausee
 of problems I had importing a large Maven project into subversion.

 The plugin will list any files under the src tree that have inconsistent
 CR, CRLF or LF line endings.

 It's a bit rough and ready, but if anyone else is interested I will
 consider sharing or publishing it.



It seems like a must-have plugin: sometimes I have problems with
inconsistent newlines. Does it produce a report? Does it manage the
svn:eol-style property, and in particular the native value?

Antonio


RE: End-of-line style plugin

2008-01-23 Thread nicklist
For what it is worth, I've adjusted the svn_apply_autoprops.py script of 
subversion to apply dos2unix to all files, which should have the svn:eol-style 
property set. This clearly makes it much easier to clean your repository or 
import code into your svn repository. Mind, the new script won't have the 
functionality of the old script, so you should make 2 scripts.

Below is the diff.

Hth,

Nick Stolwijk

Diff:

---
 # $HeadURL: 
 http://svn.collab.net/repos/svn/branches/1.4.x/contrib/client-side/svn_apply_autoprops.py
  $
 # $LastChangedRevision: 20790 $
 # $LastChangedDate: 2006-07-20 03:51:37 + (Thu, 20 Jul 2006) $
 # $LastChangedBy: dlr $
114,117c114,116
 if not dirname.count(target):
   print Will not process files in '%s' because it does not have a '%s'  
\
 directory. \
 % (dirname, SVN_WC_ADM_DIR_NAME)
---
 print Will not process files in '%s' because it does not have a '%s'  \
   directory. \
   % (dirname, SVN_WC_ADM_DIR_NAME)
132,138c131,138
   command = ['svn', 'propset', prop[0], prop[1]]
   for f in matching_filenames:
 command += [%s/%s % (dirname, f)]

   status = os.spawnvp(os.P_WAIT, 'svn', command)
   if status:
 print 'Command %s failed with exit status %s' \
---
   if prop[0] == 'svn:eol-style':
 command = ['dos2nix']
 for f in matching_filenames:
   command += [%s/%s % (dirname, f)]

 status = os.spawnvp(os.P_WAIT, 'dos2unix', command)
 if status:
   print 'Command %s failed with exit status %s' \
140c140
 sys.exit(1)
---
   sys.exit(1)



-Original Message-
From: Antonio Petrelli [mailto:[EMAIL PROTECTED]
Sent: Wed 1/23/2008 10:01 AM
To: Maven Users List
Subject: Re: End-of-line style plugin
 
2008/1/23, John Coleman [EMAIL PROTECTED]:

 I quickly threw together an end-of-line style plugin yesterday becausee
 of problems I had importing a large Maven project into subversion.

 The plugin will list any files under the src tree that have inconsistent
 CR, CRLF or LF line endings.

 It's a bit rough and ready, but if anyone else is interested I will
 consider sharing or publishing it.



It seems like a must-have plugin: sometimes I have problems with
inconsistent newlines. Does it produce a report? Does it manage the
svn:eol-style property, and in particular the native value?

Antonio



RE: End-of-line style plugin

2008-01-23 Thread Jörg Schaible
[EMAIL PROTECTED] wrote:
 For what it is worth, I've adjusted the
 svn_apply_autoprops.py script of subversion to apply dos2unix
 to all files, which should have the svn:eol-style property
 set. This clearly makes it much easier to clean your
 repository or import code into your svn repository. Mind, the
 new script won't have the functionality of the old script, so
 you should make 2 scripts.

This is unnecessary since Subversion will convert a text file on its own 
according the svn:eol-style setting if it is locally wrong.

- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: End-of-line style plugin

2008-01-23 Thread nicklist
Yes, that is correct, but

1) Your co-developer forget to set the autoprops, so a file was committed 
without the property. If you set the property yourself, it will complain when 
the eol's in the file are not correct. If you do this at large with the 
svn_auto_props script, it will complain a lot. ;)

2) You get a codebase from another party and want to add this to your codebase. 
When you add this files and your autoprops get setted, it will also complain 
when the eol's in the file are not correct.

So, the svn_apply_dos2unix script I have will solve this, by running dos2unix 
to your files, that need it, before applying the autoprops.

Hth,

Nick Stolwijk


-Original Message-
From: Jörg Schaible [mailto:[EMAIL PROTECTED]
Sent: Wed 1/23/2008 10:23 AM
To: Maven Users List
Subject: RE: End-of-line style plugin
 
[EMAIL PROTECTED] wrote:
 For what it is worth, I've adjusted the
 svn_apply_autoprops.py script of subversion to apply dos2unix
 to all files, which should have the svn:eol-style property
 set. This clearly makes it much easier to clean your
 repository or import code into your svn repository. Mind, the
 new script won't have the functionality of the old script, so
 you should make 2 scripts.

This is unnecessary since Subversion will convert a text file on its own 
according the svn:eol-style setting if it is locally wrong.

- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: End-of-line style plugin

2008-01-23 Thread nicklist

Just checked it with subversion 1.4.4 and it seems to work automatically now. 
Is this a recent fix? I know I've had problems with it.

Hth,

Nick Stolwijk

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wed 1/23/2008 10:36 AM
To: Maven Users List
Subject: RE: End-of-line style plugin
 
Yes, that is correct, but

1) Your co-developer forget to set the autoprops, so a file was committed 
without the property. If you set the property yourself, it will complain when 
the eol's in the file are not correct. If you do this at large with the 
svn_auto_props script, it will complain a lot. ;)

2) You get a codebase from another party and want to add this to your codebase. 
When you add this files and your autoprops get setted, it will also complain 
when the eol's in the file are not correct.

So, the svn_apply_dos2unix script I have will solve this, by running dos2unix 
to your files, that need it, before applying the autoprops.

Hth,

Nick Stolwijk


-Original Message-
From: Jörg Schaible [mailto:[EMAIL PROTECTED]
Sent: Wed 1/23/2008 10:23 AM
To: Maven Users List
Subject: RE: End-of-line style plugin
 
[EMAIL PROTECTED] wrote:
 For what it is worth, I've adjusted the
 svn_apply_autoprops.py script of subversion to apply dos2unix
 to all files, which should have the svn:eol-style property
 set. This clearly makes it much easier to clean your
 repository or import code into your svn repository. Mind, the
 new script won't have the functionality of the old script, so
 you should make 2 scripts.

This is unnecessary since Subversion will convert a text file on its own 
according the svn:eol-style setting if it is locally wrong.

- Jörg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





RE: End-of-line style plugin

2008-01-23 Thread John Coleman
Hi,

The report looks like this:

[warn] Z:\Audit TrailSettings.xml violation counts 83xLF 1xCRLF
1xCR
[warn] inconsistent line endings found
[info] Done with 4930 files checked 1 violations
 
No it does not look at the eol-style property, but that would be a cool
feature, because then the plugin could also enforce the selected
eol-style. Any ideas how to do this? I suppose I could just parse the
svn config file, but someone needs to explain how to apply the property
for each case.

John

 -Original Message-
 From: Antonio Petrelli [mailto:[EMAIL PROTECTED] 
 Sent: 23 January 2008 09:01
 To: Maven Users List
 Subject: Re: End-of-line style plugin
 
 2008/1/23, John Coleman [EMAIL PROTECTED]:
 
  I quickly threw together an end-of-line style plugin yesterday 
  becausee of problems I had importing a large Maven project 
 into subversion.
 
  The plugin will list any files under the src tree that have 
  inconsistent CR, CRLF or LF line endings.
 
  It's a bit rough and ready, but if anyone else is interested I will 
  consider sharing or publishing it.
 
 
 
 It seems like a must-have plugin: sometimes I have problems 
 with inconsistent newlines. Does it produce a report? Does it 
 manage the svn:eol-style property, and in particular the 
 native value?
 
 Antonio
 

Eurobase International Limited and its subsidiaries (Eurobase) are unable to 
exercise control over the content of information in E-Mails. Any views and 
opinions expressed may be personal to the sender and are not necessarily those 
of Eurobase. Eurobase will not enter into any contractual obligations in 
respect of any part of its business in any E-mail. 

Privileged / confidential information may be contained in this message and /or 
any attachments. This E-mail is intended for the use of the addressee(s) only 
and may contain confidential information. If you are not the / an intended 
recipient, you are hereby notified that any use or dissemination of this 
communication is strictly prohibited.  If you receive this transmission in 
error, please notify us immediately, and then delete this E-mail. 

Neither the sender nor Eurobase accepts any liability whatsoever for any 
defects of any kind either in or arising from this E-mail transmission. E-Mail 
transmission cannot be guaranteed to be secure or error-free, as messages can 
be intercepted, lost, corrupted, destroyed, contain viruses, or arrive late or 
incomplete. Eurobase does not accept any responsibility for viruses and it is 
your responsibility to scan any attachments.

Eurobase Systems Limited is the main trading company in the Eurobase 
International Group; registered in England and Wales as company number 
02251162; registered address: Essex House, 2 County Place, Chelmsford, Essex 
CM2 0RE, UK.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: End-of-line style plugin

2008-01-23 Thread John Coleman
The change notes for 1.4.6 mention ignoring eol-style violations * fixed: 
allow invalid svn:eol-style values (r28331)

I don't see any note about correcting the eol-styles.

John 

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: 23 January 2008 09:46
 To: Maven Users List
 Subject: RE: End-of-line style plugin
 
 
 Just checked it with subversion 1.4.4 and it seems to work 
 automatically now. Is this a recent fix? I know I've had 
 problems with it.
 
 Hth,
 
 Nick Stolwijk
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Wed 1/23/2008 10:36 AM
 To: Maven Users List
 Subject: RE: End-of-line style plugin
  
 Yes, that is correct, but
 
 1) Your co-developer forget to set the autoprops, so a file 
 was committed without the property. If you set the property 
 yourself, it will complain when the eol's in the file are not 
 correct. If you do this at large with the svn_auto_props 
 script, it will complain a lot. ;)
 
 2) You get a codebase from another party and want to add this 
 to your codebase. When you add this files and your autoprops 
 get setted, it will also complain when the eol's in the file 
 are not correct.
 
 So, the svn_apply_dos2unix script I have will solve this, by 
 running dos2unix to your files, that need it, before applying 
 the autoprops.
 
 Hth,
 
 Nick Stolwijk
 
 
 -Original Message-
 From: Jörg Schaible [mailto:[EMAIL PROTECTED]
 Sent: Wed 1/23/2008 10:23 AM
 To: Maven Users List
 Subject: RE: End-of-line style plugin
  
 [EMAIL PROTECTED] wrote:
  For what it is worth, I've adjusted the 
 svn_apply_autoprops.py script 
  of subversion to apply dos2unix to all files, which should have the 
  svn:eol-style property set. This clearly makes it much 
 easier to clean 
  your repository or import code into your svn repository. 
 Mind, the new 
  script won't have the functionality of the old script, so 
 you should 
  make 2 scripts.
 
 This is unnecessary since Subversion will convert a text file 
 on its own according the svn:eol-style setting if it is locally wrong.
 
 - Jörg
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

Eurobase International Limited and its subsidiaries (Eurobase) are unable to 
exercise control over the content of information in E-Mails. Any views and 
opinions expressed may be personal to the sender and are not necessarily those 
of Eurobase. Eurobase will not enter into any contractual obligations in 
respect of any part of its business in any E-mail. 

Privileged / confidential information may be contained in this message and /or 
any attachments. This E-mail is intended for the use of the addressee(s) only 
and may contain confidential information. If you are not the / an intended 
recipient, you are hereby notified that any use or dissemination of this 
communication is strictly prohibited.  If you receive this transmission in 
error, please notify us immediately, and then delete this E-mail. 

Neither the sender nor Eurobase accepts any liability whatsoever for any 
defects of any kind either in or arising from this E-mail transmission. E-Mail 
transmission cannot be guaranteed to be secure or error-free, as messages can 
be intercepted, lost, corrupted, destroyed, contain viruses, or arrive late or 
incomplete. Eurobase does not accept any responsibility for viruses and it is 
your responsibility to scan any attachments.

Eurobase Systems Limited is the main trading company in the Eurobase 
International Group; registered in England and Wales as company number 
02251162; registered address: Essex House, 2 County Place, Chelmsford, Essex 
CM2 0RE, UK.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: End-of-line style plugin

2008-01-23 Thread deckrider
I personally dislike any approach that changes what a developer
commits to the source code management system withput leaving a record
in that system of the original commit--it serves to undermine
confidence in that system. If one needs to enforce policy it seems
better to prohibit the commit with an informatoive error message.



On 1/23/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 For what it is worth, I've adjusted the svn_apply_autoprops.py script of
 subversion to apply dos2unix to all files, which should have the
 svn:eol-style property set. This clearly makes it much easier to clean your
 repository or import code into your svn repository. Mind, the new script
 won't have the functionality of the old script, so you should make 2
 scripts.

 Below is the diff.

 Hth,

 Nick Stolwijk

 Diff:

 ---
  # $HeadURL:
 http://svn.collab.net/repos/svn/branches/1.4.x/contrib/client-side/svn_apply_autoprops.py
 $
  # $LastChangedRevision: 20790 $
  # $LastChangedDate: 2006-07-20 03:51:37 + (Thu, 20 Jul 2006) $
  # $LastChangedBy: dlr $
 114,117c114,116
  if not dirname.count(target):
print Will not process files in '%s' because it does not have a
 '%s'  \
  directory. \
  % (dirname, SVN_WC_ADM_DIR_NAME)
 ---
  print Will not process files in '%s' because it does not have a '%s'
  \
directory. \
% (dirname, SVN_WC_ADM_DIR_NAME)
 132,138c131,138
command = ['svn', 'propset', prop[0], prop[1]]
for f in matching_filenames:
  command += [%s/%s % (dirname, f)]
 
status = os.spawnvp(os.P_WAIT, 'svn', command)
if status:
  print 'Command %s failed with exit status %s' \
 ---
if prop[0] == 'svn:eol-style':
  command = ['dos2nix']
  for f in matching_filenames:
command += [%s/%s % (dirname, f)]
 
  status = os.spawnvp(os.P_WAIT, 'dos2unix', command)
  if status:
print 'Command %s failed with exit status %s' \
 140c140
  sys.exit(1)
 ---
sys.exit(1)



 -Original Message-
 From: Antonio Petrelli [mailto:[EMAIL PROTECTED]
 Sent: Wed 1/23/2008 10:01 AM
 To: Maven Users List
 Subject: Re: End-of-line style plugin

 2008/1/23, John Coleman [EMAIL PROTECTED]:
 
  I quickly threw together an end-of-line style plugin yesterday becausee
  of problems I had importing a large Maven project into subversion.
 
  The plugin will list any files under the src tree that have inconsistent
  CR, CRLF or LF line endings.
 
  It's a bit rough and ready, but if anyone else is interested I will
  consider sharing or publishing it.



 It seems like a must-have plugin: sometimes I have problems with
 inconsistent newlines. Does it produce a report? Does it manage the
 svn:eol-style property, and in particular the native value?

 Antonio




-- 
ASCII ribbon campaign:
()  against HTML email
/\  against Microsoft attachments
Information:  http://www.expita.com/nomime.html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: End-of-line style plugin

2008-01-23 Thread nicklist
The original svn_auto_props works only on your working copy and the new script, 
svn_apply_dos2unix the same. So no automatically changing anything, you have to 
review and commit the changes yourself.

And on a sidenote to John: I know again why I needed that script, some of the 
files had inconsistent new lines, so mixed up windows/unix eol style. Applying 
dos2unix to those solved that.

Hth,

Nick Stolwijk


-Original Message-
From: deckrider [mailto:[EMAIL PROTECTED]
Sent: Wed 1/23/2008 3:09 PM
To: Maven Users List
Subject: Re: End-of-line style plugin
 
I personally dislike any approach that changes what a developer
commits to the source code management system withput leaving a record
in that system of the original commit--it serves to undermine
confidence in that system. If one needs to enforce policy it seems
better to prohibit the commit with an informatoive error message.



On 1/23/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 For what it is worth, I've adjusted the svn_apply_autoprops.py script of
 subversion to apply dos2unix to all files, which should have the
 svn:eol-style property set. This clearly makes it much easier to clean your
 repository or import code into your svn repository. Mind, the new script
 won't have the functionality of the old script, so you should make 2
 scripts.

 Below is the diff.

 Hth,

 Nick Stolwijk

 Diff:

 ---
  # $HeadURL:
 http://svn.collab.net/repos/svn/branches/1.4.x/contrib/client-side/svn_apply_autoprops.py
 $
  # $LastChangedRevision: 20790 $
  # $LastChangedDate: 2006-07-20 03:51:37 + (Thu, 20 Jul 2006) $
  # $LastChangedBy: dlr $
 114,117c114,116
  if not dirname.count(target):
print Will not process files in '%s' because it does not have a
 '%s'  \
  directory. \
  % (dirname, SVN_WC_ADM_DIR_NAME)
 ---
  print Will not process files in '%s' because it does not have a '%s'
  \
directory. \
% (dirname, SVN_WC_ADM_DIR_NAME)
 132,138c131,138
command = ['svn', 'propset', prop[0], prop[1]]
for f in matching_filenames:
  command += [%s/%s % (dirname, f)]
 
status = os.spawnvp(os.P_WAIT, 'svn', command)
if status:
  print 'Command %s failed with exit status %s' \
 ---
if prop[0] == 'svn:eol-style':
  command = ['dos2nix']
  for f in matching_filenames:
command += [%s/%s % (dirname, f)]
 
  status = os.spawnvp(os.P_WAIT, 'dos2unix', command)
  if status:
print 'Command %s failed with exit status %s' \
 140c140
  sys.exit(1)
 ---
sys.exit(1)



 -Original Message-
 From: Antonio Petrelli [mailto:[EMAIL PROTECTED]
 Sent: Wed 1/23/2008 10:01 AM
 To: Maven Users List
 Subject: Re: End-of-line style plugin

 2008/1/23, John Coleman [EMAIL PROTECTED]:
 
  I quickly threw together an end-of-line style plugin yesterday becausee
  of problems I had importing a large Maven project into subversion.
 
  The plugin will list any files under the src tree that have inconsistent
  CR, CRLF or LF line endings.
 
  It's a bit rough and ready, but if anyone else is interested I will
  consider sharing or publishing it.



 It seems like a must-have plugin: sometimes I have problems with
 inconsistent newlines. Does it produce a report? Does it manage the
 svn:eol-style property, and in particular the native value?

 Antonio




-- 
ASCII ribbon campaign:
()  against HTML email
/\  against Microsoft attachments
Information:  http://www.expita.com/nomime.html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: End-of-line style plugin

2008-01-23 Thread Brian E. Fox
Couldn't this already be checked with checkstyle and/or pmd?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 23, 2008 9:38 AM
To: Maven Users List
Subject: RE: End-of-line style plugin

The original svn_auto_props works only on your working copy and the new
script, svn_apply_dos2unix the same. So no automatically changing
anything, you have to review and commit the changes yourself.

And on a sidenote to John: I know again why I needed that script, some
of the files had inconsistent new lines, so mixed up windows/unix eol
style. Applying dos2unix to those solved that.

Hth,

Nick Stolwijk


-Original Message-
From: deckrider [mailto:[EMAIL PROTECTED]
Sent: Wed 1/23/2008 3:09 PM
To: Maven Users List
Subject: Re: End-of-line style plugin
 
I personally dislike any approach that changes what a developer
commits to the source code management system withput leaving a record
in that system of the original commit--it serves to undermine
confidence in that system. If one needs to enforce policy it seems
better to prohibit the commit with an informatoive error message.



On 1/23/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 For what it is worth, I've adjusted the svn_apply_autoprops.py script
of
 subversion to apply dos2unix to all files, which should have the
 svn:eol-style property set. This clearly makes it much easier to clean
your
 repository or import code into your svn repository. Mind, the new
script
 won't have the functionality of the old script, so you should make 2
 scripts.

 Below is the diff.

 Hth,

 Nick Stolwijk

 Diff:

 ---
  # $HeadURL:

http://svn.collab.net/repos/svn/branches/1.4.x/contrib/client-side/svn_a
pply_autoprops.py
 $
  # $LastChangedRevision: 20790 $
  # $LastChangedDate: 2006-07-20 03:51:37 + (Thu, 20 Jul 2006) $
  # $LastChangedBy: dlr $
 114,117c114,116
  if not dirname.count(target):
print Will not process files in '%s' because it does not have
a
 '%s'  \
  directory. \
  % (dirname, SVN_WC_ADM_DIR_NAME)
 ---
  print Will not process files in '%s' because it does not have a
'%s'
  \
directory. \
% (dirname, SVN_WC_ADM_DIR_NAME)
 132,138c131,138
command = ['svn', 'propset', prop[0], prop[1]]
for f in matching_filenames:
  command += [%s/%s % (dirname, f)]
 
status = os.spawnvp(os.P_WAIT, 'svn', command)
if status:
  print 'Command %s failed with exit status %s' \
 ---
if prop[0] == 'svn:eol-style':
  command = ['dos2nix']
  for f in matching_filenames:
command += [%s/%s % (dirname, f)]
 
  status = os.spawnvp(os.P_WAIT, 'dos2unix', command)
  if status:
print 'Command %s failed with exit status %s' \
 140c140
  sys.exit(1)
 ---
sys.exit(1)



 -Original Message-
 From: Antonio Petrelli [mailto:[EMAIL PROTECTED]
 Sent: Wed 1/23/2008 10:01 AM
 To: Maven Users List
 Subject: Re: End-of-line style plugin

 2008/1/23, John Coleman [EMAIL PROTECTED]:
 
  I quickly threw together an end-of-line style plugin yesterday
becausee
  of problems I had importing a large Maven project into subversion.
 
  The plugin will list any files under the src tree that have
inconsistent
  CR, CRLF or LF line endings.
 
  It's a bit rough and ready, but if anyone else is interested I will
  consider sharing or publishing it.



 It seems like a must-have plugin: sometimes I have problems with
 inconsistent newlines. Does it produce a report? Does it manage the
 svn:eol-style property, and in particular the native value?

 Antonio




-- 
ASCII ribbon campaign:
()  against HTML email
/\  against Microsoft attachments
Information:  http://www.expita.com/nomime.html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]