harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Etienne M. Gagnon (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-291) Set file properties in the Subversion repository
Date Sun, 02 Apr 2006 02:53:26 GMT
Set file properties in the Subversion repository
------------------------------------------------

         Key: HARMONY-291
         URL: http://issues.apache.org/jira/browse/HARMONY-291
     Project: Harmony
        Type: Improvement
  Components: Misc  
    Reporter: Etienne M. Gagnon
    Priority: Trivial


Currently, file properties are not set in the repository.  This causes much grief when people
work on text files in different systems (Windows, Linux).

Ideally, the svn:mime-type property should be set for all files in the repository.  Minimally,
2 settings are needed:

* Text files (*.java, *.c, *.h, Makefile, README, LICENSE, etc.):  

  svn:mime-type : text/plain
  svn:eol-style : native

* Binary files

  svn:mime-type : application/octet-stream

Of course, one could go one step further and use more precise mime-types, such as text/html,
but the above is sufficient for usual Subversion usage.

Occasionally, some files might need to maintain a specific EOL (end of line) setting, e.g.:

* Batch file for Windows (*.BAT)

  svn:mime-type : text/plain
  svn:eol-style : CRLF

* bash script:

  svn:mime-type : text/plain
  svn:eol-style : LF

Usually, the file extention is sufficient to determine the type of a file.  Here are example
scripts to set up the file properties efficiently (handles file names with spaces):

$ # -- Handle *.java files
$ find . -type f | grep -v '/\.svn/' | grep '\.java$' | awk '{print "\"" $0 "\""}' | xargs
svn ps svn:mime-type text/plain
$ find . -type f | grep -v '/\.svn/' | grep '\.java$' | awk '{print "\"" $0 "\""}' | xargs
svn ps svn:eol-style native
$
$ # -- Handle *.jar files
$ find . -type f | grep -v '/\.svn/' | grep '\.jar$' | awk '{print "\"" $0 "\""}' | xargs
svn ps svn:mime-type application/octet-stream

The above must be repeated for each file extention, appropriately.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message