This project is archived and is in readonly mode.
script/plugin install git://whatever does nothing
-
Rizwan Reza
It doesn't give me any problems. What git version are you using?
-
Nate Wiger
[nwiger@example.com]$ git --version
git version 1.5.6 [nwiger@example.com]$ which git /usr/local/bin/git [nwiger@example.com]$ uname -a Darwin example.com 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 -
Nate Wiger
- Tag changed from 3.0pre, bug, plugin, scriptplugin to 2.3.5, 3.0pre, bug, patch, plugin, scriptplugin
Updated to latest git from git-scm.com, and Rails 2.3.5, and it still fails.
The reason is that it appears
rails-2.3.5/lib/commands/plugin.rbis trying usegit pullto grab the plugin code (see theinstall_using_gitmethod), which doesn't work right.Example:
script/plugin install git://github.com/fesplugas/typus.gitmkdir vendor/plugins/typus cd vendor/plugins/typus git init git pull --depth 1 git://github.com/fesplugas/typus.gitThat last line exits 1, but that error is being masked by the
install_using_gitmethod, and the directory is justrm -rf'ed.I'm not sure the reasoning behind
git initthengit pullsince a simplegit cloneworks:cd vendor/plugins git clone -q git://github.com/fesplugas/typus.gitThe following patch to the
install_using_gitmethod fixes the issue.I also tested using a template, which now works:
rails typustest -m http://gist.github.com/86613.txt -
Prem Sichanugrist (sikachu)
- State changed from new to invalid
Sorry, but I can't reproduce this problem on both 2.3.5 and
masterI don't really know why they were doing
initandpull, but doing so will leave you with plugin which not on any branch, and not tracking the remote. -
Nate Wiger
WOW, Prem, thanks a ton. You have been so helpful. So let me get this straight:
- I give you an exact version of git to use
- I give you exact steps to follow
- I give you a patch to FIX the problem
And you close the ticket as invalid.
Did you actually try any of the above three?
If I'm hitting this, it means other people are too. I will be glad to help track it down further, and of course there's always the possibility that it's a configuration/firewall/SSH problem on my end. But EITHER WAY, even if that is the case, at the very least this ticket should result in improved documentation.
Please reopen, you can email me directly so we can sort this out.
Nate Wiger
PlayStation -
Matt Aimonetti (mattetti)
- State changed from invalid to open
- Assigned user set to Matt Aimonetti (mattetti)
- Milestone cleared.
Thanks Nate, that seems like a valid problem to me. The generator moved in rails3 and your patch won't apply.
Give me some time to review the different options and make sure we cover all cases (like trying to install to update a plugin from a got repo) and even maybe ping some git experts to see what they think.- Matt
-
Prem Sichanugrist (sikachu)
- State changed from open to incomplete
I've tried my best, Nate. I spent a whole day of my time building an ubuntu 9.10 VM, and then install Git 1.5.6 on it. Sorry, but I couldn't reproduce your problem.
Here's my output:
sikachu@sikachu-ubuntu:~$ cd blog sikachu@sikachu-ubuntu:~/blog$ git --version git version 1.5.6 sikachu@sikachu-ubuntu:~/blog$ which git /usr/local/bin/git sikachu@sikachu-ubuntu:~/blog$ uname -a Linux sikachu-ubuntu 2.6.31-14-server #48-Ubuntu SMP Fri Oct 16 15:07:34 UTC 2009 x86_64 GNU/Linux sikachu@sikachu-ubuntu:~/blog$ script/plugin install git://github.com/fesplugas/typus.git Initialized empty Git repository in /home/sikachu/blog/vendor/plugins/typus/.git/ warning: no common commits remote: Counting objects: 297, done. remote: Compressing objects: 100% (254/254), done. remote: Total 297 (delta 23), reused 155 (delta 3) Receiving objects: 100% (297/297), 155.98 KiB | 35 KiB/s, done. Resolving deltas: 100% (23/23), done. From git://github.com/fesplugas/typus * branch HEAD -> FETCH_HEAD sikachu@sikachu-ubuntu:~/blog$ ls -la vendor/plugins/ total 12 drwxr-xr-x 3 sikachu sikachu 4096 2010-02-06 22:36 . drwxr-xr-x 3 sikachu sikachu 4096 2010-02-06 21:29 .. drwxr-xr-x 9 sikachu sikachu 4096 2010-02-06 22:36 typusI also tried using your template, and it also installed fine.
From your suggestion, if you change
git init; git pullcombination togit clone, it will break the ability to specify a revision you want to fetch sincegit clonedoesn't support it.However, to update the documentation of something is always useful. Could you resubmit the patch to update the documentation? Git looks like a black box to me, and I don't know that there's a way to debug what's going on and made your installation fail.
-
Nate Wiger
I tracked this down to a conflict with ~/.gitconfig. If I remove these lines it works:
[branch "master"] remote = origin merge = refs/heads/masterIt appears a naked git pull has problems with these settings.
It's probably fair to say this should be a little footnote/gotcha somewhere in the plugin documentation. Where should it go?
-
Rizwan Reza
Is this still a problem, Nate?
-
Nate Wiger
You can close it. My last post showed how to fix it.
-
Rizwan Reza
- State changed from incomplete to invalid
-
Dan Croak
I just hit this problem as well on Rails 3.0.3. Removing the lines Nate identified solved the problem but it seems like there should be some smart code in Rails so it "just works" since it's so common for people to have this in their ~/.gitconfig:
[branch "master"] remote = origin merge = refs/heads/masterI'd be happy to have a hand at a patch if folks agree Rails should try to handle this.
