[Project-managers] Binary files in CoinWeb SVN repo

Matthew Saltzman mjs at ces.clemson.edu
Sat Oct 22 18:28:37 EDT 2005


When the original SVN CoinWeb repo was created from the coin-web CVS repo,
binary files that were not correctly marked as such in CVS (i.e., most of 
them) were incorrectly imported into SVN as text files.  I have corrected 
all of these problems (as far as I can tell).  If you come upon any 
corrupted binary files, let me know.  (FWIW, I also corrected the markings 
of binary files in the old CVS repo.)

It is important (even more so than for CVS) that SVN have correct 
information about the types of files in the repository.  SVN has a notion 
of "properties" associated with files, which is described in the manual at 
subversion.tigris.org.  The key properties for proper recognition of 
binary files are "svn:eol-style" and "svn:mime-type".

When a file is added to a repository, there is a primitive recognition 
heuristic.  Text files get "svn:eol-style=native" and binary files get 
"svn:mime-type=application/octet-stream".  But it is useful for Web sites 
to have better mime-type information where possible.

Mime-types can often be deduced from file extensions.  Unfortunately, SVN 
does not have a mechanism on the server side for setting mime-types.  It 
is the responsibility of the clients (i.e., you) to properly set 
mime-types.  The Unix SVN client does have a mechanism for automatically 
setting mime-types (and the Windows clients probably do as well).  For the 
Unix client, there are directives in the file ~/.subversion/config.  After 
doing these repairs, I've included the following directives in my 
.subversion/config:

    [miscellany]
    enable-auto-props = yes
    [auto-props]
    *.c        = svn:eol-style=native
    *.cpp      = svn:eol-style=native
    *.h        = svn:eol-style=native
    *.hpp      = svn:eol-style=native
    # *.dsp = svn:eol-style=CRLF
    # *.dsw = svn:eol-style=CRLF
    *.sh       = svn:eol-style=native;svn:executable
    *.txt      = svn:eol-style=native
    *.png      = svn:mime-type=image/png
    *.jpg      = svn:mime-type=image/jpeg
    *.JPG      = svn:mime-type=image/jpeg
    *.jpeg     = svn:mime-type=image/jpeg
    *.JPEG     = svn:mime-type=image/jpeg
    *.gif      = svn:mime-type=image/gif
    *.GIF      = svn:mime-type=image/gif
    *.rtf      = svn:mime-type=application/rtf
    *.RTF      = svn:mime-type=application/rtf
    *.pdf      = svn:mime-type=application/pdf
    *.PDF      = svn:mime-type=application/pdf
    *.db       = svn:mime-type=application/octet-stream
    *.ico      = svn:mime-type=application/octet-stream
    *.mov      = svn:mime-type=video/quicktime
    *.MOV      = svn:mime-type=video/quicktime
    *.avi      = svn:mime-type=video/x-msvideo
    *.AVI      = svn:mime-type=video/x-msvideo
    *.mpg      = svn:mime-type=video/mpeg
    *.MPG      = svn:mime-type=video/mpeg
    *.mpeg     = svn:mime-type=video/mpeg
    *.MPEG     = svn:mime-type=video/mpeg
    *.mpe      = svn:mime-type=video/mpeg
    *.MPE      = svn:mime-type=video/mpeg
    *.zip      = svn:mime-type=application/zip
    *.tgz      = svn:mime-type=application/x-gzip
    *.gz       = svn:mime-type=application/x-gzip
    *.doc      = svn:mime-type=application/msword
    *.ppt      = svn:mime-type=application/vnd.ms-powerpoint
    *.xls      = svn:mime-type=application/vnd.ms-excel
    *.sxw      = svn:mime-type=application/vnd.sun.xml.
    *.sxc      = svn:mime-type=application/vnd.sun.xml.writer
    *.sxd      = svn:mime-type=application/vnd.sun.xml.calc
    *.sxi      = svn:mime-type=application/vnd.sun.xml.impress
    *.sxm      = svn:mime-type=application/vnd.sun.xml.math
    *.mso      = svn:mime-type=application/octet-stream
    *.wmf      = svn:mime-type=application/octet-stream
    *.wmz      = svn:mime-type=application/x-gzip
    *.prz      = svn:mime-type=application/octet-stream
    Makefile   = svn:eol-style=native
    Makefile.* = svn:eol-style=native

 		Matt


More information about the Project-managers mailing list