<div dir="ltr">I would voice a word of caution on using submodules in Git. &nbsp;Yes, they are similar to svn:externals, but in my experience, they are very fragile. &nbsp;The fragility comes in when/if you need to switch the submodule URL/definition from what it is currently to something else. &nbsp;I&#39;ve had no end of trouble with this, as have several others. &nbsp;<div>
<br></div><div>My current take on Git submodules is that I either don&#39;t use them, or I fork whatever it is I&#39;d want as a submodule, and reference my fork as the submodule. &nbsp;That way, if I need to make changes, switch from someone&#39;s git repo of something to someone else&#39;s or whatever, all that is contained in my fork, instead of having to switch the submodule in my project.<br>
<br><div class="gmail_quote">On Tue, Sep 2, 2008 at 2:49 PM, Tim Haines <span dir="ltr">&lt;<a href="mailto:tmhaines@gmail.com">tmhaines@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr">Hi James,<br><br>Thanks for writing these instructions up in detail.&nbsp; I&#39;ve just followed them and will play around with them over the next few days.&nbsp; A couple of questions<br><br>1) I assume with submodules I can create and switch to branches of the submodules if I want to try my app out with some patches applied to rspec or rails?&nbsp; There&#39;s no hidden gotch&#39;ya here?<br>

<br>2) When I&#39;m getting near deployment for production (a few months away yet) I&#39;m thinking of freezing to a tagged version of Rails.&nbsp; (Not sure this terminology is still correct with Git - but basically I might stick with Rails 2.2 or something - but I&#39;m not sure this has benefits anymore).&nbsp; How would you go about this?<br>

<br>Cheers,<br><br>Tim. <br><br><div class="gmail_quote">On Tue, Jun 3, 2008 at 3:14 AM, James B. Byrne <span dir="ltr">&lt;<a href="mailto:byrnejb@harte-lyne.ca" target="_blank">byrnejb@harte-lyne.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<br>
&gt;<br>
&gt; Message: 2<br>
&gt; Date: Thu, 29 May 2008 06:35:01 -0700<br>
&gt; From: David Chelimsky &lt;<a href="mailto:dchelimsky@gmail.com" target="_blank">dchelimsky@gmail.com</a>&gt;<br>
&gt; Subject: Re: [rspec-users] Coloured output in rspec 1.1.4<br>
&gt; To: <a href="mailto:rspec-users@rubyforge.org" target="_blank">rspec-users@rubyforge.org</a><br>
&gt; Message-ID: &lt;<a href="mailto:175B70FE-B706-4C03-8B20-C5B207268AD6@gmail.com" target="_blank">175B70FE-B706-4C03-8B20-C5B207268AD6@gmail.com</a>&gt;<br>
&gt; Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes<br>
&gt;<br>
&gt; On May 29, 2008, at 6:32 AM, Juanma Cervera wrote:<br>
&gt;<br>
&gt;&gt; David Chelimsky wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Actually - that is not from 1.1.4 - it&#39;s a patch that was introduced<br>
&gt;&gt;&gt; after the 1.1.4 release. Did you follow the install directions at<br>
&gt;&gt;&gt; <a href="http://github.com/dchelimsky/rspec-rails/wikis" target="_blank">http://github.com/dchelimsky/rspec-rails/wikis</a>?<br>
&gt;&gt;<br>
&gt;&gt; More or less.<br>
&gt;&gt; I have git-cloned from github repositories instead of make<br>
&gt;&gt; &quot;script/plugin install&quot;<br>
&gt;<br>
&gt; script/plugin install doesn&#39;t support getting a specific version from<br>
&gt; git yet. To do that you have to use &#39;git clone&#39; and then &#39;git checkout<br>
&gt; 1.1.4&#39; (in this case).<br>
&gt;<br>
<br>
As an alternative to script/plugin or git-clone, you can employ git-submodules<br>
(on GiT v1.5.3 or later) to obtain the effect of subversion externals. &nbsp;For<br>
example:<br>
<br>
---&gt;<br>
<br>
$ git-submodule add \<br>
 &nbsp; &nbsp;git://<a href="http://github.com/dchelimsky/rspec.git" target="_blank">github.com/dchelimsky/rspec.git</a> \<br>
 &nbsp; &nbsp;vendor/plugins/rspec<br>
<br>
Initialized empty Git repository in<br>
/home/byrnejb/projects/proforma.git/vendor/plugins/rspec/.git/<br>
remote: Counting objects: 46810, done.<br>
remote: Compressing objects: 100% (10646/10646), done.<br>
remote: Total 46810 (delta 33521), reused 46810 (delta 33521)<br>
Receiving objects: 100% (46810/46810), 5.99 MiB | 103 KiB/s, done.<br>
Resolving deltas: 100% (33521/33521), done.<br>
<br>
$ ll vendor/plugins<br>
total 16<br>
drwxrwxr-x &nbsp;6 byrnejb byrnejb 4096 May 28 14:06 routing_navigator<br>
drwxrwxr-x 12 byrnejb byrnejb 4096 Jun &nbsp;2 10:09 rspec<br>
<br>
$ git-submodule add \<br>
 &nbsp; &nbsp;git://<a href="http://github.com/dchelimsky/rspec-rails.git" target="_blank">github.com/dchelimsky/rspec-rails.git</a> \<br>
 &nbsp; &nbsp;vendor/plugins/rspec-rails<br>
<br>
Initialized empty Git repository in<br>
/home/byrnejb/projects/proforma.git/vendor/plugins/rspec-rails/.git/<br>
remote: Counting objects: 46530, done.<br>
remote: Compressing objects: 100% (10649/10649), done.<br>
remote: Total 46530 (delta 33241), reused 46530 (delta 33241)<br>
Receiving objects: 100% (46530/46530), 5.94 MiB | 63 KiB/s, done.<br>
Resolving deltas: 100% (33241/33241), done.<br>
<br>
$ git-status<br>
# On branch master<br>
# Changes to be committed:<br>
# &nbsp; (use &quot;git reset HEAD &lt;file&gt;...&quot; to unstage)<br>
#<br>
# &nbsp; &nbsp; &nbsp; modified: &nbsp; .gitmodules<br>
# &nbsp; &nbsp; &nbsp; new file: &nbsp; vendor/plugins/rspec<br>
# &nbsp; &nbsp; &nbsp; new file: &nbsp; vendor/plugins/rspec-rails<br>
#<br>
<br>
$ git-submodule init<br>
<br>
Submodule &#39;vendor/plugins/rspec&#39; (git://<a href="http://github.com/dchelimsky/rspec.git" target="_blank">github.com/dchelimsky/rspec.git</a>)<br>
registered for path &#39;vendor/plugins/rspec&#39;<br>
Submodule &#39;vendor/plugins/rspec-rails&#39;<br>
(git://<a href="http://github.com/dchelimsky/rspec-rails.git" target="_blank">github.com/dchelimsky/rspec-rails.git</a>) registered for path<br>
&#39;vendor/plugins/rspec-rails&#39;<br>
<br>
$ git-status<br>
# On branch master<br>
# Changes to be committed:<br>
# &nbsp; (use &quot;git reset HEAD &lt;file&gt;...&quot; to unstage)<br>
#<br>
# &nbsp; &nbsp; &nbsp; modified: &nbsp; .gitmodules<br>
# &nbsp; &nbsp; &nbsp; new file: &nbsp; vendor/plugins/rspec<br>
# &nbsp; &nbsp; &nbsp; new file: &nbsp; vendor/plugins/rspec-rails<br>
#<br>
<br>
$ git-commit -m &quot;Added Rspec and Rspec-Rails as submodules&quot;<br>
<br>
Created commit b4d1133: Added Rspec and Rspec-Rails as submodules<br>
&nbsp;3 files changed, 8 insertions(+), 0 deletions(-)<br>
&nbsp;create mode 160000 vendor/plugins/rspec<br>
&nbsp;create mode 160000 vendor/plugins/rspec-rails<br>
<br>
$ git-status<br>
# On branch master<br>
nothing to commit (working directory clean)<br>
<br>
$ git-push # over ssh<br>
!!Warning!! - &nbsp; Any attempt to obtain access to this device without<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;authorization is a criminal act.<br>
<a href="mailto:byrnejb@vcs-git.hamilton.harte-lyne.ca" target="_blank">byrnejb@vcs-git.hamilton.harte-lyne.ca</a>&#39;s password:<br>
Counting objects: 9, done.<br>
Compressing objects: 100% (5/5), done.<br>
Writing objects: 100% (5/5), 607 bytes, done.<br>
Total 5 (delta 1), reused 0 (delta 0)<br>
To ssh://<a href="http://byrnejb@vcs-git.hamilton.harte-lyne.ca/var/data/vcs-git/hll/proforma.git" target="_blank">byrnejb@vcs-git.hamilton.harte-lyne.ca/var/data/vcs-git/hll/proforma.git</a><br>
 &nbsp; ab5353b..b4d1133 &nbsp;master -&gt; master<br>
<br>
$<br>
<br>
&lt;---<br>
<br>
Now, when anyone pulls from the canonical repository they will get Rspec and<br>
Rspec-on-Rails as well, but as submodules pulled directly from the RSpec<br>
repositories. &nbsp;Further, updating all submodules thereafter requires just these<br>
three steps:<br>
<br>
$git-submodule update<br>
$git-commit<br>
$git-push<br>
<br>
This is how I load edge rails as well, as a submodule:<br>
<br>
$ git-submodule add git://<a href="http://github.com/rails/rails.git" target="_blank">github.com/rails/rails.git</a> vendor/rails<br>
$ git-submodule init<br>
$ git-commit<br>
$ git-push<br>
<br>
Once you do this you can locally checkout any version or branch that is<br>
available in the submodule.<br>
<br>
Regards,<br>
<br>
--<br>
*** &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;E-Mail is NOT a SECURE channel &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;***<br>
James B. Byrne &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mailto:<a href="mailto:ByrneJB@Harte-Lyne.ca" target="_blank">ByrneJB@Harte-Lyne.ca</a><br>
Harte &amp; Lyne Limited &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.harte-lyne.ca" target="_blank">http://www.harte-lyne.ca</a><br>
9 Brockley Drive &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;vox: +1 905 561 1241<br>
Hamilton, Ontario &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fax: +1 905 561 0757<br>
Canada &nbsp;L8E 3C3<br>
<br>
_______________________________________________<br>
rspec-users mailing list<br>
<a href="mailto:rspec-users@rubyforge.org" target="_blank">rspec-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
</blockquote></div><br></div>
<br>_______________________________________________<br>
rspec-users mailing list<br>
<a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Christopher Bailey<br>Cobalt Edge LLC<br>
<a href="http://cobaltedge.com">http://cobaltedge.com</a><br>
</div></div>