script/plugin install doesn’t support getting a specific version from
git yet. To do that you have to use ‘git clone’ and then ‘git checkout
1.1.4’ (in this case).
As an alternative to script/plugin or git-clone, you can employ
git-submodules
(on GiT v1.5.3 or later) to obtain the effect of subversion externals.
For
example:
—>
$ git-submodule add
git://github.com/dchelimsky/rspec.git
vendor/plugins/rspec
Initialized empty Git repository in
/home/byrnejb/projects/proforma.git/vendor/plugins/rspec/.git/
remote: Counting objects: 46810, done.
remote: Compressing objects: 100% (10646/10646), done.
remote: Total 46810 (delta 33521), reused 46810 (delta 33521)
Receiving objects: 100% (46810/46810), 5.99 MiB | 103 KiB/s, done.
Resolving deltas: 100% (33521/33521), done.
$ ll vendor/plugins
total 16
drwxrwxr-x 6 byrnejb byrnejb 4096 May 28 14:06 routing_navigator
drwxrwxr-x 12 byrnejb byrnejb 4096 Jun 2 10:09 rspec
$ git-submodule add
git://github.com/dchelimsky/rspec-rails.git
vendor/plugins/rspec-rails
Initialized empty Git repository in
/home/byrnejb/projects/proforma.git/vendor/plugins/rspec-rails/.git/
remote: Counting objects: 46530, done.
remote: Compressing objects: 100% (10649/10649), done.
remote: Total 46530 (delta 33241), reused 46530 (delta 33241)
Receiving objects: 100% (46530/46530), 5.94 MiB | 63 KiB/s, done.
Resolving deltas: 100% (33241/33241), done.
$ git-status
On branch master
Changes to be committed:
(use “git reset HEAD …” to unstage)
modified: .gitmodules
new file: vendor/plugins/rspec
new file: vendor/plugins/rspec-rails
$ git-submodule init
Submodule ‘vendor/plugins/rspec’ (git://github.com/dchelimsky/rspec.git)
registered for path ‘vendor/plugins/rspec’
Submodule ‘vendor/plugins/rspec-rails’
(git://github.com/dchelimsky/rspec-rails.git) registered for path
‘vendor/plugins/rspec-rails’
$ git-status
On branch master
Changes to be committed:
(use “git reset HEAD …” to unstage)
modified: .gitmodules
new file: vendor/plugins/rspec
new file: vendor/plugins/rspec-rails
$ git-commit -m “Added Rspec and Rspec-Rails as submodules”
Created commit b4d1133: Added Rspec and Rspec-Rails as submodules
3 files changed, 8 insertions(+), 0 deletions(-)
create mode 160000 vendor/plugins/rspec
create mode 160000 vendor/plugins/rspec-rails
$ git-status
On branch master
nothing to commit (working directory clean)
$ git-push # over ssh
!!Warning!! - Any attempt to obtain access to this device without
authorization is a criminal act.
[email protected]’s password:
Counting objects: 9, done.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 607 bytes, done.
Total 5 (delta 1), reused 0 (delta 0)
To
ssh://[email protected]/var/data/vcs-git/hll/proforma.git
ab5353b…b4d1133 master → master
$
<—
Now, when anyone pulls from the canonical repository they will get Rspec
and
Rspec-on-Rails as well, but as submodules pulled directly from the RSpec
repositories. Further, updating all submodules thereafter requires just
these
three steps:
$git-submodule update
$git-commit
$git-push
This is how I load edge rails as well, as a submodule:
$ git-submodule add git://github.com/rails/rails.git vendor/rails
$ git-submodule init
$ git-commit
$ git-push
Once you do this you can locally checkout any version or branch that is
available in the submodule.
Regards,
–
*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:[email protected]
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3