views:

284

answers:

2

I noticed that if I do something like:

script/plugin install git://github.com/plug-xyz.git

It says it is creating a .git folder:

Initialized empty Git repository in /Users/g/Documents/app/vendor/plugins/xyz/.git/

But after the plugin is installed, it seems that the .git folder is gone.

I ask because when I try to update the plugin, nothing happens. It says it is updating, but when I check the files, they have not been updated to the latest version. I then removed the plugin, and re-installed it, and it was able to grab the most recent version.

Is it not possible to perform script/plugin update on git plugins?

+2  A: 

You can see the changeset here: http://dev.rubyonrails.org/changeset/9049

It does remove the .git folder, presumably to save space by not storing history. This is traditional for a source control "install" instead of "checkout" or "clone" command, although it doesn't use a hypothetical "git install" command to do this.

script/plugin update looks for the .svn directory in each plugin so it can run svn update. That obviously won't work for git checkouts whether or not their .git folder has been removed. You should edit that script and send them a patch to enable the git version of update. It would probably be a pretty simple change.

joeforker
how does it update the plugin then?
gmoniey
The update command looks for .svn directories and runs svn update on those directories. You could patch it to support git if that's important to you.
joeforker
Ahh...I see....thanks
gmoniey
A: 

.git folder is removed so that it doesn't get checked into your own SCM. For example, not everyone's using Git as their SCM (me for one) and wouldn't want to check in .git repos into my own for obvious reasons.

According to the help spat out by script/plugin, -x option would add SVN external. I found these two articles addressing this specific issue, but haven't tried solutions since I don't use .git

alex