Homesource Forums

Homeworld Source Editing Talk
It is currently Mon Sep 25, 2017 10:54 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Nov 10, 2006 9:06 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
The Subversion file properties svn:mime-type and svn:eol-style are now mandatory (a pre-commit hook script enforces it). I've backfilled these properties for all the files currently in the code base.

Why? Since we're a cross-platform project, it's not uncommon for a developer's text editor to save files with completely different line endings from the original because they are using a different operating system. The resulting diff then looks like the whole file has changed when it hasn't which makes determining what's actually changed very difficult. Subversion's svn:eol-style solves this problem by specifying what the line endings should be when the file is checked out. svn:eol-style=native is particularly handy since the line endings will be whatever is customary for the operating system being used. In short, from this point on diffs should only contain actual changes rather than being swamped with extra changes made by a text editor without your knowledge. This is a good thing.

This change won't adversely affect you unless you try to commit a new file without either of these settings. Adding of new files should be relatively infrequent. For text files, you can add these properties by:

Code:
svn propset svn:mime-type text/plain <file path>
svn propset svn:eol-style native     <file path>

Binary files should be marked as:

Code:
svn propset svn:mime-type application/octet-stream <file path>

You can get Subversion to add these properties automatically when you svn add a file by updating your configuration file (~/.subversion/config) with something like:

Code:
[miscellany]
enable-auto-props = yes

# Any additional entries should have svn:mime-type set.
# If svn:mime-type=text/plain then also set svn:eol-style=native
[auto-props]
*.am      = svn:mime-type=text/plain;svn:eol-style=native
*.c       = svn:mime-type=text/plain;svn:eol-style=native
*.cpp     = svn:mime-type=text/plain;svn:eol-style=native
*.h       = svn:mime-type=text/plain;svn:eol-style=native
*.icns    = svn:mime-type=application/octet-stream
*.jpg     = svn:mime-type=image/jpeg
*.kas     = svn:mime-type=text/plain;svn:eol-style=native
*.kash    = svn:mime-type=text/plain;svn:eol-style=native
*.lua     = svn:mime-type=text/plain;svn:eol-style=native
*.o       = svn:mime-type=application/octet-stream
*.obj     = svn:mime-type=application/octet-stream
*.plist   = svn:mime-type=text/plain;svn:eol-style=native
*.png     = svn:mime-type=image/png
*.sh      = svn:mime-type=text/plain;svn:eol-style=native;svn:executable
*.sln     = svn:mime-type=text/plain;svn:eol-style=native
*.strings = svn:mime-type=text/plain;svn:eol-style=native
*.txt     = svn:mime-type=text/plain;svn:eol-style=native
*.vcproj  = svn:mime-type=text/plain;svn:eol-style=native

The pre-commit script will remind you of all of this if it detects that the properties have been forgotten.

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 11, 2006 8:27 am 
Offline
coder
User avatar

Joined: Wed Oct 04, 2006 8:13 pm
Posts: 94
Location: UTC -0500
thanks

for tortoise svn users, your config file should be located at:
C:\Documents and Settings\username\Application Data\Subversion\config

_________________
http://againsttcpa.com/what-is-tcpa.html
http://google.com/search?q=c+programming+faq
http://research.att.com/~bs
acronyms.ch, neworder.box.sk


Last edited by nova on Sat Nov 18, 2006 12:31 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sun Nov 12, 2006 5:48 am 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
lmop wrote:
The Subversion file properties svn:mime-type and svn:eol-style are now mandatory (a pre-commit hook script enforces it).


But the real question is utf-8, utf-16, Western European, or Mandarin?... :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group