[rspec-devel] Some weirdness with the repo

Pat Maddox pergesu at gmail.com
Fri Apr 4 16:52:39 EDT 2008

On Fri, Apr 4, 2008 at 1:21 PM, Pat Maddox <pergesu at gmail.com> wrote:
> Hey everyone,
>  The rspec-devel repo was in a funky state.  Both rspec and rspec-rails
>  were added as submodules, but the rspec-rails directory had some files
>  already committed to it.  This meant that if you branched the parent
>  repo or rspec-rails, they were tied together and commits would go into
>  the master only.  I fixed this by trashing the rspec-rails directory
>  and re-adding it as a submodule.
>  You can partly see the problem by looking at the history:
>  http://github.com/dchelimsky/rspec-dev/tree/10c789caa5eb366921a2bf388e6d3c781c85d674/example_rails_app/vendor/plugins
>  http://github.com/dchelimsky/rspec-dev/tree/master/example_rails_app/vendor/plugins
>  As you can see in the latest one, there's no mention of rspec or
>  rspec-rails, which is how it should be.
>  Updating your code should probably Just Work, but if you notice any
>  wonkiness then you're probably best off just doing a fresh clone.
>  Pat

I found a potential source of the problem.  When you commit a
submodule, you have to go back to the parent and add the submodule so
that it knows which commit to link to.  If you do

git add example_rails_app/vendor/plugins/rspec-rails

then it's fine, but if you do

git add example_rails_app/vendor/plugins/rspec-rails/ (notice the
trailing slash)

then it blows away the submodule and just adds the files.

I'm investigating to see if there's a way we can protect against
that...but in the mean time just be careful, or only use "git commit


More information about the rspec-devel mailing list