<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="text">Blog entries tagged subversion :: mwop.net</title>
  <updated>2011-03-15T15:34:34-05:00</updated>
  <generator uri="https://getlaminas.org" version="2">Laminas_Feed_Writer</generator>
  <link rel="alternate" type="text/html" href="https://mwop.net/blog/tag/subversion"/>
  <link rel="self" type="application/atom+xml" href="https://mwop.net/blog/tag/subversion/atom.xml"/>
  <id>https://mwop.net/blog/tag/subversion</id>
  <entry xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <title type="html"><![CDATA[Git Subtree Merging Guide]]></title>
    <published>2011-03-10T09:30:00-06:00</published>
    <updated>2011-03-15T15:34:34-05:00</updated>
    <link rel="alternate" type="text/html" href="https://mwop.net/blog/258-Git-Subtree-Merging-Guide.html"/>
    <id>https://mwop.net/blog/258-Git-Subtree-Merging-Guide.html</id>
    <author>
      <name>Matthew Weier O'Phinney</name>
      <email>contact@mwop.net</email>
      <uri>https://mwop.net</uri>
    </author>
    <content xmlns:xhtml="http://www.w3.org/1999/xhtml" type="xhtml">
      <xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml"><xhtml:p>I've been investigating ways to incorporate third-party
repositories and libraries into my <xhtml:a href="http://git-scm.org/">Git</xhtml:a> projects. Subversion's
<xhtml:code>svn:externals</xhtml:code> capabilities are one compelling feature
for that particular VCS, and few, if any, other VCS systems,
particularly the DVCS systems, have a truly viable equivalent. Git
<xhtml:code>submodules</xhtml:code> aren't terrible, but they assume you want
the entire repository — whereas SVN allows you to cherry-pick
subdirectories if desired.</xhtml:p>
<xhtml:p>Why might I want to link only a subdirectory? Consider a project
with this structure:</xhtml:p>
<xhtml:pre><xhtml:code class="language- hljs" data-lang="">docs/
    api/
    manual/
        html/
        module_specs/
library/
    Foo/
        ComponentA/
        ComponentB/
tests/
    Foo/
        ComponentA/
        ComponentB/
</xhtml:code></xhtml:pre>
<xhtml:p>On another project, I want to use ComponentB. With
<xhtml:code>svn:externals</xhtml:code>, this is easy:</xhtml:p>
<xhtml:pre><xhtml:code class="language-ruby hljs ruby" data-lang="ruby">library/Foo/ComponentB <xhtml:span class="hljs-symbol">http:</xhtml:span>/<xhtml:span class="hljs-regexp">/repohost/svn</xhtml:span><xhtml:span class="hljs-regexp">/trunk/library</xhtml:span><xhtml:span class="hljs-regexp">/Foo/</xhtml:span>ComponentB
</xhtml:code></xhtml:pre>
<xhtml:p>and now the directory is added and tracked.</xhtml:p>
<xhtml:p>With Git, it's a different story. One solution I've found is
using <xhtml:a href="https://github.com/apenwarr/git-subtree">git-subtree</xhtml:a>, an
extension to Git. It takes a bit more effort to setup than
<xhtml:code>svn:externals</xhtml:code>, but offers the benefits of easily
freezing on a specific commit, and squashing all changes into a
single commit.</xhtml:p>
<xhtml:p><xhtml:a href="http://h2ik.co">Jon Whitcraft</xhtml:a> recently had some
questions about how to use it, and I answered him via email.
Evidently what I gave him worked for him, as he then requested if
he could post my guide — which <xhtml:a href="http://h2ik.co/2011/03/having-fun-with-git-subtree/">you can find
here</xhtml:a>.</xhtml:p>
<xhtml:div class="h-entry"><xhtml:img class="u-photo photo" width="50" src="https://avatars0.githubusercontent.com/u/25943?v=3&amp;u=79dd2ea1d4d8855944715d09ee4c86215027fa80&amp;s=140" alt="matthew"/> <xhtml:a class="u-url u-uid p-name" href="https://mwop.net/blog/258-Git-Subtree-Merging-Guide.html">Git
Subtree Merging Guide</xhtml:a> was originally published <xhtml:time class="dt-published" datetime="2011-03-10T09:30:00-06:00">10 March
2011</xhtml:time> on <xhtml:a href="https://mwop.net">https://mwop.net</xhtml:a> by
<xhtml:a rel="author" class="p-author" href="https://mwop.net">Matthew
Weier O'Phinney</xhtml:a>.</xhtml:div>
</xhtml:div>
    </content>
  </entry>
  <entry xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <title type="html"><![CDATA[git-svn Tip: don't use core.autocrlf]]></title>
    <published>2008-09-24T12:16:27-05:00</published>
    <updated>2008-09-24T12:16:27-05:00</updated>
    <link rel="alternate" type="text/html" href="https://mwop.net/blog/191-git-svn-Tip-dont-use-core.autocrlf.html"/>
    <id>https://mwop.net/blog/191-git-svn-Tip-dont-use-core.autocrlf.html</id>
    <author>
      <name>Matthew Weier O'Phinney</name>
      <email>contact@mwop.net</email>
      <uri>https://mwop.net</uri>
    </author>
    <content xmlns:xhtml="http://www.w3.org/1999/xhtml" type="xhtml">
      <xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml"><xhtml:p>I've been playing around with <xhtml:a href="http://git.or.cz/">Git</xhtml:a> in the past couple months, and have
been really enjoying it. Paired with subversion, I get the best of
all worlds — distributed source control when I want it (working on
new features or trying out performance tuning), and non-distributed
source control for my public commits.</xhtml:p>
<xhtml:p><xhtml:a href="http://github.com/guides/dealing-with-newlines-in-git">Github</xhtml:a>
suggests that when working with remote repositories, you turn on
the <xhtml:code>autocrlf</xhtml:code> option, which ensures that changes in
line endings do not get accounted for when pushing to and pulling
from the remote repo. However, when working with
<xhtml:code>git-svn</xhtml:code>, this actually causes issues. After turning
this option on, I started getting the error "Delta source ended
unexpectedly" from <xhtml:code>git-svn</xhtml:code>. After a bunch of aimless
tinkering, I finally asked myself the questions, "When did this
start happening?" and, "Have I changed anything with Git lately?"
Once I'd backed out the config change, all started working
again.</xhtml:p>
<xhtml:p>In summary: don't use <xhtml:code>git config --global core.autocrlf
true</xhtml:code> when using <xhtml:code>git-svn</xhtml:code>.</xhtml:p>
<xhtml:div class="h-entry"><xhtml:img class="u-photo photo" width="50" src="https://avatars0.githubusercontent.com/u/25943?v=3&amp;u=79dd2ea1d4d8855944715d09ee4c86215027fa80&amp;s=140" alt="matthew"/> <xhtml:a class="u-url u-uid p-name" href="https://mwop.net/blog/191-git-svn-Tip-dont-use-core.autocrlf.html">
git-svn Tip: don't use core.autocrlf</xhtml:a> was originally published
<xhtml:time class="dt-published" datetime="2008-09-24T12:16:27-05:00">24
September 2008</xhtml:time> on <xhtml:a href="https://mwop.net">https://mwop.net</xhtml:a> by <xhtml:a rel="author" class="p-author" href="https://mwop.net">Matthew Weier
O'Phinney</xhtml:a>.</xhtml:div>
</xhtml:div>
    </content>
  </entry>
</feed>
