<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>榆树网 &#187; svn</title>
	<atom:link href="http://www.wenzk.com/archives/tag/svn/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wenzk.com</link>
	<description>http://www.wenzk.com</description>
	<lastBuildDate>Fri, 03 Sep 2010 13:37:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Subversion or Git</title>
		<link>http://www.wenzk.com/archives/498</link>
		<comments>http://www.wenzk.com/archives/498#comments</comments>
		<pubDate>Mon, 28 Dec 2009 01:21:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-杂项]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[比较]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=498</guid>
		<description><![CDATA[There’s been a lot of ambient (and not so ambient) noise in the geeky corners where I often linger about Git. There seems to be some sort of mass exodus underway as folks indicate that they have, or are planning to, move away from Subversion for their source control needs and I have to admit [...]]]></description>
			<content:encoded><![CDATA[<p>There’s been a lot of ambient (and not so ambient) noise in the  geeky corners where I often linger about <a href="http://git.or.cz/">Git</a>.   There seems to be some sort of mass exodus underway as folks indicate  that they have, or are planning to, move away from <a href="http://subversion.tigris.org/">Subversion</a> for their source  control needs and I have to admit that I’m feeling a little ignorant.</p>
<p><span id="more-498"></span>I haven’t used Git (yet?), but I’ve been doing some reading and I  still don’t quite understand the infatuation.  Don’t get me wrong, it  looks like there are some nice features, but at what cost?</p>
<p>The key difference between the two systems seems to be the model  itself.  Where Subversion offers a centralized model, Git provides a  decentralized model.  At the risk of over simplification, this means  that Git offers each developer their very own, fully autonomous copy of  the <em>entire</em> repository.  With Subversion, each developer has  their own working copy, but commits changes to a single, central  repository.</p>
<p>The arguments in favor of the decentralized approach, as I  understand them, include:</p>
<h3>Speed</h3>
<p>Okay, I like speed.  Since each developer has a local copy of the  entire repository, fundamental actions like diff, commit, etc. are all  local.  That’s always going to be faster.  Fast is good.</p>
<p>That said, server interaction with Subversion isn’t exactly  excessive.  Developers work in local working directories and only  interact with the server in short bursts.  I’ve never found myself  thinking, “Great Scott, this is unbearably slow.”  For me, at least,  this seems like a fix for something that isn’t broken.</p>
<h3>Smaller Space Requirement</h3>
<p>A Subversion working directory contains two copies of the entire  code base.  One that is actually being worked on and another tucked away  in the .svn directory.  I remember  reading somewhere that the Mozilla repository required ~12Gb of storage  in Subversion and ~420Mb in Git.</p>
<p>This is a substantial difference, to be sure, but there’s a phrase  that <em>everyone</em> in technology hears on a daily basis: <cite>storage  is cheap.</cite> That can’t be a compelling argument for one problem  and not for another, so I don’t think this difference is one that’s  going to precipitate a switch all by itself.</p>
<h3>Line Ending Conversion</h3>
<p>This is an important factor for mixed environment teams.  Evidently  early versions of Git made no changes and more recent version handle the  conversion automatically.  That decisioning is manual with Subversion,  but is spectacularly easy to do by making a simple change to ~/.subversion/config for each file extension  impacted to specify the line ending desired:</p>
<p><code>*.sh = svn:eol-style=LF;</code></p>
<h3>Other Concerns</h3>
<p>In addition to the fact that none of the arguments presented in  favor of Git are particularly compelling to me, at least not the way I  understand them, I have a few other concerns about the decentralized  model.  Actually, they probably all roll up to a single concern –  accountability.</p>
<p>Every project I’ve worked on requires some level of immediate or  semi-immediate accountability.  A project manager who needs to ensure  that an appropriate amount of progress has been made against the project  plan, a boss who needs to spot review code or maybe a continuous  integration process that needs regular repository updates so that its  not just rebuilding the same old thing.</p>
<p>It seems like the decentralization of the repository would hamper  those efforts.  Sure, it can be done, but it would have to be done with  process.</p>
<p>I also wonder if, in a team environment, having too many people  doing too much of their own thing for intervals that stretch too long  would make effective merges all but impossible.  It seems like it would.</p>
<p>Am I missing something?  Are there additional benefits?  Is there  anything else I haven’t even mentioned that I should be considering?   I’d love to hear from other source control users who have moved to Git  from Subversion.</p>
<p>From: http://robwilkerson.org/2008/04/05/subversion-or-git/</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/527" title="浅谈FreeBSD与OpenBSD">浅谈FreeBSD与OpenBSD</a> (0)</li><li><a href="http://www.wenzk.com/archives/470" title="解决：Can&#8217;t open file &#8216;/root/.subversion/servers&#8217;:  Permission denied错误">解决：Can&#8217;t open file &#8216;/root/.subversion/servers&#8217;:  Permission denied错误</a> (0)</li><li><a href="http://www.wenzk.com/archives/461" title=" Path-Based Authorization by mod_authz_svn"> Path-Based Authorization by mod_authz_svn</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/498/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决：Can&#8217;t open file &#8216;/root/.subversion/servers&#8217;:  Permission denied错误</title>
		<link>http://www.wenzk.com/archives/470</link>
		<comments>http://www.wenzk.com/archives/470#comments</comments>
		<pubDate>Thu, 26 Nov 2009 15:18:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[svnadmin]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=470</guid>
		<description><![CDATA[This problem occurs as an effect of apache beeing run as root. Though commands are still issued by the apache 'http' user, the home directory are for some reason still '/root'. This results in the error "svn: warning: Can't open file '/root/.subversion/servers': Permission denied" beeing logged in /var/log/http/error_log, and no svnrepo are created. The obvious [...]]]></description>
			<content:encoded><![CDATA[<pre>This problem occurs as an effect of apache beeing run as root.
Though commands are still issued by the apache 'http' user, the home
directory are for some reason still '/root'.
<span id="more-470"></span>
This results in the error
"svn: warning: Can't open file '/root/.subversion/servers':
Permission denied"
beeing logged in /var/log/http/error_log, and no svnrepo are
created.

The obvious workaround to this, is to issue a command like 'export
HOME=/srv/svn/' or 'export HOME=/home/svn/' before svnadmin is
called.

My current workaround is the stupid simple:
$cfg['svnadmin_path'] = 'export HOME=/srv/svn; '.'svnadmin';

A sufficient fix for this issue migth be just to mention this in the
SyncSvn documentation. (I'll be happy to compile a small patch for
this)

I have read about similar issues taking place on Redhat and Fedora
with php scripts trying to call svnadmin.

From: http://projects.ceondo.com/p/indefero/issues/155/</pre>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/670" title="几个PHP关于URL和eMail分析方面的类">几个PHP关于URL和eMail分析方面的类</a> (0)</li><li><a href="http://www.wenzk.com/archives/498" title="Subversion or Git ">Subversion or Git </a> (0)</li><li><a href="http://www.wenzk.com/archives/461" title=" Path-Based Authorization by mod_authz_svn"> Path-Based Authorization by mod_authz_svn</a> (0)</li><li><a href="http://www.wenzk.com/archives/203" title="Nginx中PHP+FastCGI配置技巧">Nginx中PHP+FastCGI配置技巧</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/470/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Path-Based Authorization by mod_authz_svn</title>
		<link>http://www.wenzk.com/archives/461</link>
		<comments>http://www.wenzk.com/archives/461#comments</comments>
		<pubDate>Mon, 23 Nov 2009 14:31:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[authorization]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[访问控制]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=461</guid>
		<description><![CDATA[Both Apache and svnserve are capable of granting (or denying) permissions to users. Typically this is done over the entire repository: a user can read the repository (or not), and she can write to the repository (or not). It&#8217;s also possible, however, to define finer-grained access rules. One set of users may have permission to [...]]]></description>
			<content:encoded><![CDATA[<p>Both Apache and <span><strong>svnserve</strong></span> are capable of       granting (or denying) permissions to users.  Typically this is       done over the entire repository: a user can read the repository       (or not), and she can write to the repository (or not).  It&#8217;s       also possible, however, to define finer-grained access rules.       One set of users may have permission to write to a certain       directory in the repository, but not others; another directory       might not even be readable by all but a few special       people.</p>
<p><span id="more-461"></span>Both servers use a common file format to describe these       path-based access rules.  In the case of Apache, one needs to       load the <span><strong>mod_authz_svn</strong></span> module and then add       the <code>AuthzSVNAccessFile</code> directive  (within       the <code>httpd.conf</code> file) pointing to  your own       rules file.  (For a full explanation, see       <a title="Per-directory access control" href="http://durak.org/sean/pubs/software/version-control-with-subversion-1.6/svn.serverconfig.httpd.html#svn.serverconfig.httpd.authz.perdir">the section called “Per-directory  access control”</a>.)  If       you&#8217;re using <span><strong>svnserve</strong></span>,  you need to make       the <code>authz-db</code> variable       (within <code>svnserve.conf</code>) point to your       rules file.</p>
<div title="Do You Really Need Path-Based Access  Control?">
<p><strong>Do You Really Need Path-Based Access Control?</strong></p>
<p>A lot of administrators setting up Subversion for the         first time tend to jump into path-based access control without         giving it a lot of thought.  The administrator usually knows         which teams of people are working on which projects, so it&#8217;s         easy to jump in and grant certain teams access to certain         directories and not others.  It seems like a natural thing,         and it appeases the administrator&#8217;s desire to maintain tight         control of the repository.</p>
<p>Note, though, that there are often invisible (and         visible!) costs associated with this feature.  In the visible         category, the server needs to do a lot more work to ensure         that the user has the right to read or write each specific         path; in certain situations, there&#8217;s very noticeable         performance loss.  In the invisible category, consider the         culture you&#8217;re creating.  Most of the time, while certain         users <span><em>shouldn&#8217;t</em></span> be  committing changes to         certain parts of the repository, that social contract doesn&#8217;t         need to be technologically enforced.  Teams can sometimes         spontaneously collaborate with each other; someone may want to         help someone else out by committing to an area she doesn&#8217;t         normally work on.  By preventing this sort of thing at the         server level, you&#8217;re setting up barriers to unexpected         collaboration.  You&#8217;re also creating a bunch of rules that         need to be maintained as projects develop, new users are         added, and so on.  It&#8217;s a bunch of extra work to         maintain.</p>
<p>Remember that this is a version control system!  Even if         somebody accidentally commits a change to something she         shouldn&#8217;t, it&#8217;s easy to undo the change.  And if a user         commits to the wrong place with deliberate malice, it&#8217;s a         social problem anyway, and that the problem needs to be dealt         with outside Subversion.</p>
<p>So, before you begin restricting users&#8217; access rights, ask         yourself whether there&#8217;s a real, honest need for this, or  whether it&#8217;s         just something that <span>“<span>sounds  good</span>”</span> to an         administrator.  Decide whether it&#8217;s worth sacrificing some         server speed, and remember that there&#8217;s very little risk         involved; it&#8217;s bad to become dependent on technology as a         crutch for social problems.         <sup>[<a id="id635843" href="http://durak.org/sean/pubs/software/version-control-with-subversion-1.6/svn.serverconfig.pathbasedauthz.html#ftn.id635843">49</a>]</sup></p>
<p>As an example to ponder, consider that the Subversion         project itself has always had a notion of who is allowed to         commit where, but it&#8217;s always been enforced socially.  This is         a good model of community trust, especially for open source         projects.  Of course, sometimes there <span><em>are</em></span> truly legitimate needs for path-based access control; within         corporations, for example, certain types of data really can be         sensitive, and access needs to be genuinely restricted to         small groups of people.</div>
<p>Once your server knows where to find your rules file, it&#8217;s       time to define the rules.</p>
<p>The syntax of the file is the same familiar one used       by <code>svnserve.conf</code> and the runtime       configuration files.  Lines that start with a hash       (<code>#</code>) are ignored.  In its simplest  form, each       section names a repository and path within it, as well as the       authenticated usernames are the option names within each       section.  The value of each option describes the user&#8217;s level of       access to the repository path: either       <code>r</code> (read-only) or <code>rw</code> (read/write).  If the user is not mentioned at all, no access is       allowed.</p>
<p>To be more specific: the value of the section names is       either of the form <code>[repos-name:path]</code> or of the       form <code>[path]</code>.  If you&#8217;re using the       <code>SVNParentPath</code> directive, it&#8217;s  important       to specify the repository names in your sections.  If you omit       them, a section such as       <code>[/some/dir]</code> will match the path       <code>/some/dir</code> in <span><em>every</em></span> repository.  If you&#8217;re using the <code>SVNPath</code> directive, however, it&#8217;s fine to only define paths in your       sections—after all, there&#8217;s only one repository.</p>
<pre>[calc:/branches/calc/bug-142]
harry = rw
sally = r</pre>
<p>In this first example, the user <code>harry</code> has       full read and write access on the       <code>/branches/calc/bug-142</code> directory in  the       <code>calc</code> repository, but the user       <code>sally</code> has read-only access.  Any  other users       are blocked from accessing this directory.</p>
<p>Of course, permissions are inherited from parent to child       directory.  That means we can specify a subdirectory with a       different access policy for Sally:</p>
<pre>[calc:/branches/calc/bug-142]
harry = rw
sally = r

# give sally write access only to the 'testing' subdir
[calc:/branches/calc/bug-142/testing]
sally = rw</pre>
<p>Now Sally can write to the <code>testing</code> subdirectory of the branch, but can still only read other parts.       Harry, meanwhile, continues to have complete read/write access       to the whole branch.</p>
<p>It&#8217;s also possible to explicitly deny permission to someone       via inheritance rules, by setting the username variable to       nothing:</p>
<pre>[calc:/branches/calc/bug-142]
harry = rw
sally = r

[calc:/branches/calc/bug-142/secret]
harry =</pre>
<p>In this example, Harry has read/write access to the       entire <code>bug-142</code> tree, but has  absolutely no       access at all to the <code>secret</code> subdirectory       within it.</p>
<div style="margin-left: 0.5in; margin-right: 0.5in;" title="Tip">
<table border="0" summary="Tip">
<tbody>
<tr>
<td rowspan="2" width="25" align="center" valign="top"><img src="http://www.wenzk.com/wp-content/uploads/2010/03/7a42_tip.png" alt="[Tip]" /></td>
<th align="left">Tip</th>
</tr>
<tr>
<td align="left" valign="top">The thing to remember is that the most specific path         always matches first.  The server tries to match the path         itself, and then the parent of the path, then the parent of         that, and so on.  The net effect is that mentioning a specific         path in the access file will always override any permissions         inherited from parent directories.</td>
</tr>
</tbody>
</table>
</div>
<p>By default, nobody has any access to the repository at all.       That means that if you&#8217;re starting with an empty file, you&#8217;ll       probably want to give at least read permission to all users at       the root of the repository.  You can do this by using the       asterisk variable (<code>*</code>), which means <span>“<span>all       users</span>”</span>:</p>
<pre>[/]
* = r</pre>
<p>This is a common setup; notice that no repository       name is mentioned in the section name.  This makes all  repositories       world-readable to all users.  Once all users have read access to       the repositories, you can give explicit       <code>rw</code> permission to certain users on  specific       subdirectories within specific repositories.</p>
<p>The asterisk variable (<code>*</code>) is also  worth       special mention because it&#8217;s the       <span><em>only</em></span> pattern that matches  an anonymous       user.  If you&#8217;ve configured your server block to allow a mixture       of anonymous and authenticated access, all users start out       accessing anonymously.  The server looks for a       <code>*</code> value defined for the path being  accessed;       if it can&#8217;t find one, it demands real authentication from       the client.</p>
<p>The access file also allows you to define whole groups of       users, much like the Unix <code>/etc/group</code> file:</p>
<pre>[groups]
calc-developers = harry, sally, joe
paint-developers = frank, sally, jane
everyone = harry, sally, joe, frank, sally, jane</pre>
<p>Groups can be granted access control just like users.       Distinguish them with an <span>“<span>at</span>”</span> (<code>@</code>) prefix:</p>
<pre>[calc:/projects/calc]
@calc-developers = rw

[paint:/projects/paint]
jane = r
@paint-developers = rw</pre>
<p>Another important fact is that     the <span><em>first</em></span> matching rule is  the one which gets     applied to a user.  In the prior example, even though Jane is a     member of the <code>paint-developers</code> group  (which has     read/write access), the <code>jane = r</code> rule  will be     discovered and matched before the group rule, thus denying Jane     write access.</p>
<p>Groups can also be defined to contain other groups:</p>
<pre>[groups]
calc-developers = harry, sally, joe
paint-developers = frank, sally, jane
everyone = @calc-developers, @paint-developers</pre>
<p>Subversion 1.5 brings another useful feature to the access       file syntax:  username aliases.  Some authentication systems       expect and carry relatively short usernames of the sorts we&#8217;ve       been describing here—<code>harry</code>,       <code>sally</code>, <code>joe</code>,  and so on.  But       other authentication systems—such as those which use LDAP       stores or SSL client certificates—may carry much more       complex usernames.  For example, Harry&#8217;s username in an       LDAP-protected system might be <code>CN=Harold       Hacker,OU=Engineers,DC=red-bean,DC=com</code>.  With       usernames like that, the access file can become quite bloated       with long or obscure usernames that are easy to mistype.       Fortunately, username aliases allow you to have to type the       correct complex username only once, in a statement which assigns  to       it a more easily digestable alias.</p>
<pre>[aliases]
harry = CN=Harold Hacker,OU=Engineers,DC=red-bean,DC=com
sally = CN=Sally Swatterbug,OU=Engineers,DC=red-bean,DC=com
joe = CN=Gerald I. Joseph,OU=Engineers,DC=red-bean,DC=com
…</pre>
<p>Once you&#8217;ve defined a set of aliases, you can refer to the       users elsewhere in the access file via their aliases in all the       same places you could have instead used their actual usernames.       Simply prepend an ampersand to the alias to distinguish it from       a regular username:</p>
<pre>[groups]
calc-developers = &amp;harry, &amp;sally, &amp;joe
paint-developers = &amp;frank, &amp;sally, &amp;jane
everyone = @calc-developers, @paint-developers</pre>
<p>You might also choose to use aliases if your users&#8217;       usernames change frequently.  Doing so allows you to need to       update only the aliases table when these username changes occur,       instead of doing global-search-and-replace operations on the       whole access file.</p>
<div title="Partial Readability and Checkouts">
<p><strong>Partial Readability and Checkouts</strong></p>
<p>If you&#8217;re using Apache as your Subversion server and have       made certain subdirectories of your repository unreadable to       certain users, you need to be aware of a possible       nonoptimal behavior with <span><strong>svn  checkout</strong></span>.</p>
<p>When the client requests a checkout or update over HTTP, it       makes a single server request and receives a single (often       large) server response.  When the server receives the request,       that is the <span><em>only</em></span> opportunity Apache has to       demand user authentication.  This has some odd side effects.       For example, if a certain subdirectory of the repository is       readable only by user Sally, and user Harry checks out a parent       directory, his client will respond to the initial authentication       challenge as Harry.  As the server generates the large response,       there&#8217;s no way it can resend an authentication challenge when       it reaches the special subdirectory; thus the subdirectory is       skipped altogether, rather than asking the user to       reauthenticate as Sally at the right moment.  In a similar way,       if the root of the repository is anonymously world-readable,       the entire checkout will be done without       authentication—again, skipping the unreadable directory,       rather than asking for authentication partway through.</p>
<p>From: http://durak.org/sean/pubs/software/version-control-with-subversion-1.6/svn.serverconfig.pathbasedauthz.html</p></div>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/498" title="Subversion or Git ">Subversion or Git </a> (0)</li><li><a href="http://www.wenzk.com/archives/470" title="解决：Can&#8217;t open file &#8216;/root/.subversion/servers&#8217;:  Permission denied错误">解决：Can&#8217;t open file &#8216;/root/.subversion/servers&#8217;:  Permission denied错误</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/461/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
