OpenJPA
  1. OpenJPA
  2. OPENJPA-896

Several source files include Windows EoL chars

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.0.3, 1.1.0, 1.2.0
    • Fix Version/s: 1.0.4, 1.2.2, 1.3.0, 2.0.0-M2
    • Component/s: docs
    • Labels:
      None

      Description

      Several of the doc files include the Windows Ctrl+M chars at the end of lines when checked out to non-Windows platforms (like MacOSX and Linux), due to the committer not using the ASF suggested svn config values - http://www.apache.org/dev/svn-eol-style.txt

      From http://www.apache.org/dev/version-control.html -
      Configuring the Subversion client

      Committers will need to properly configure their svn client. One particular issue is OS-specific line-endings for text files. When you add a new text file, especially when applying patches from Bugzilla, first ensure that the line-endings are appropriate for your system, then do ...

      svn add test.txt
      svn propset svn:eol-style native test.txt

      Your svn client can be configured to do that automatically for some common file types. Add the contents of the file http://www.apache.org/dev/svn-eol-style.txt to your ~/.subversion/config file. [Note: for Windows this is normally found at C:\Documents and Settings\{username}\Application Data\Subversion\config]

      Some files may need additional properties to be set, for example svn:executable=* should be applied to those script files (e.g. .bat, .cgi, .cmd, .sh) that are intended to be executed. Since not all such files are necessarily intended to be executed, the executable property should not be made an automatic default.

      However, you should still pay attention to the messages from your svn client when you do 'svn commit'.

      1. OPENJPA-896-trunk.patch
        406 kB
        Donald Woods
      2. OPENJPA-896-trunk-withprops.patch
        411 kB
        Donald Woods

        Issue Links

          Activity

          Donald Woods made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Michael Dick made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.0.4 [ 12313301 ]
          Fix Version/s 1.2.2 [ 12313681 ]
          Resolution Fixed [ 1 ]
          Hide
          Michael Dick added a comment -

          Sounded like enough committers thought this was safe so I went ahead and ran a script to convert eol characters

          The script does :
          svn propset svn:eol-style native $

          {file}
          dostounix ${file}

          For every .java or .xml file in the source tree.

          Show
          Michael Dick added a comment - Sounded like enough committers thought this was safe so I went ahead and ran a script to convert eol characters The script does : svn propset svn:eol-style native $ {file} dostounix ${file} For every .java or .xml file in the source tree.
          Donald Woods made changes -
          Fix Version/s 1.0.4 [ 12313301 ]
          Michael Dick made changes -
          Fix Version/s 1.2.1 [ 12313328 ]
          Hide
          Jeremy Bauer added a comment -

          +1 use a single JIRA.

          +1 we do it in a single big commit (ie no functional changes)

          If the change is made, can you (Donald) inform folks on how to setup their environment so that we don't end up back in the same state in the future? Commits to existing files are not typically an issue, but new files using Windows eol's may get committed without proper setup. I've probably committed a few, myself.

          Show
          Jeremy Bauer added a comment - +1 use a single JIRA. +1 we do it in a single big commit (ie no functional changes) If the change is made, can you (Donald) inform folks on how to setup their environment so that we don't end up back in the same state in the future? Commits to existing files are not typically an issue, but new files using Windows eol's may get committed without proper setup. I've probably committed a few, myself.
          Michael Dick made changes -
          Fix Version/s 1.2.1 [ 12313328 ]
          Affects Version/s 1.1.0 [ 12312344 ]
          Affects Version/s 1.0.3 [ 12312969 ]
          Affects Version/s 1.2.0 [ 12313102 ]
          Fix Version/s 1.0.4 [ 12313301 ]
          Summary Several doc files include Windows EoL chars Several source files include Windows EoL chars
          Fix Version/s 1.3.0 [ 12313326 ]
          Assignee Michael Dick [ mikedd ]
          Hide
          Michael Dick added a comment -

          Per Don's email to the dev mailing list several java files also contain windows eol characters. Unless someone disagrees I think we should use a single JIRA issue to resolve both problems.

          I'm not sure why I don't see the problem when running svn diff on linux, but I see how this can be a pain for those who do.

          Proposed solution execute these commands on all .xml, .java files in the source tree
          svn propset svn:eol-style native
          dos2unix

          Per conversation on the dev mailing list this is acceptable provided we do it in a single big commit (ie no functional changes).

          If this approach is not sufficient or anyone disagrees that we should do this please comment here.

          Show
          Michael Dick added a comment - Per Don's email to the dev mailing list several java files also contain windows eol characters. Unless someone disagrees I think we should use a single JIRA issue to resolve both problems. I'm not sure why I don't see the problem when running svn diff on linux, but I see how this can be a pain for those who do. Proposed solution execute these commands on all .xml, .java files in the source tree svn propset svn:eol-style native dos2unix Per conversation on the dev mailing list this is acceptable provided we do it in a single big commit (ie no functional changes). If this approach is not sufficient or anyone disagrees that we should do this please comment here.
          Hide
          Donald Woods added a comment -

          You can manually add the svn props after applying the first patch <OPENJPA-896-trunk.patch> by:

          cd openjpa-project/src/doc/manual
          svn propset svn:eol-style native *.xml
          svn propset svn:eol-style native *.xsl
          
          Show
          Donald Woods added a comment - You can manually add the svn props after applying the first patch < OPENJPA-896 -trunk.patch> by: cd openjpa-project/src/doc/manual svn propset svn:eol-style native *.xml svn propset svn:eol-style native *.xsl
          Donald Woods made changes -
          Attachment OPENJPA-896-trunk-withprops.patch [ 12399489 ]
          Hide
          Donald Woods added a comment -

          Updated patch <OPENJPA-896-trunk-withprops.patch> that fixes the EOL chars and includes adding the svn:eol-style=native on the xml and xsl files.

          Show
          Donald Woods added a comment - Updated patch < OPENJPA-896 -trunk-withprops.patch> that fixes the EOL chars and includes adding the svn:eol-style=native on the xml and xsl files.
          Donald Woods made changes -
          Attachment OPENJPA-896-trunk.patch [ 12399471 ]
          Hide
          Donald Woods added a comment -

          Patch file which removes the Windows Ctrl+M EOL chars.
          For Windows users, you can use a program like SlickEdit to resave the files in Unix format (and fix your svn config.)
          For Unix/Linux users, use the "dos2unix *.xml" command.
          For Mac users, you need to provide a dos2unix script that uses the tr command -

          #! /bin/sh
          for x
          do
          echo "Converting $x"
          tr -d '\015' < "$x" > "$x.tmp"
          mv "$x.tmp" "$x"
          done
          
          Show
          Donald Woods added a comment - Patch file which removes the Windows Ctrl+M EOL chars. For Windows users, you can use a program like SlickEdit to resave the files in Unix format (and fix your svn config.) For Unix/Linux users, use the "dos2unix *.xml" command. For Mac users, you need to provide a dos2unix script that uses the tr command - #! /bin/sh for x do echo "Converting $x" tr -d '\015' < "$x" > "$x.tmp" mv "$x.tmp" "$x" done
          Donald Woods made changes -
          Field Original Value New Value
          Link This issue is related to OPENJPA-890 [ OPENJPA-890 ]
          Donald Woods created issue -

            People

            • Assignee:
              Michael Dick
              Reporter:
              Donald Woods
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development