Forum: Radiant CMS Another git question with regards to extensions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3c415075c9e778e2d38ebf4588a68464?d=identicon&s=25 Nate Turnage (Guest)
on 2008-12-31 07:35
(Received via mailing list)
I am trying to get a handle on git and am having some difficulty
understanding how to manage my projects. My project was built outside of
version control where my extensions used were all git-cloned into my
project. Two of the extensions (page_attachments and copy_move) are
using
previous revisions set up as local branches. The project directory was
then
initialized as a local git repo and the remote.upload.url variable was
set
up. I can 'git push upload master' to my online git server at Rails
Playground. It all seems to work properly, but if I try and git-clone my
project to test if it's working, none of the extensions have any files
in
the vendor/extensions/extensionX directories.

In the past when I was using subversion to manage my projects a
git-cloned
extension maintained its content. How should I be adding extensions to
my
project so that travel with the project?


~Nate
8802b1fa1b53e2197beea9454244f847?d=identicon&s=25 Sean Cribbs (seancribbs)
on 2008-12-31 13:45
(Received via mailing list)
The typical method is with `git submodule`.  So if I were to install
page_attachments manually, it would be like so:

$ git submodule add
git://github.com/radiant/radiant-page-attachments-extension.git
vendor/extensions/page_attachments
$ git submodule init && git submodule update

You'll likely need to remove the original extension installation before
you use submodules. Once it's installed correctly as a submodule, you
can use pull/reset within the extension directory to put it on the
revision that you prefer to use, then commit to the main project to lock
in that revision.

Sean
8802b1fa1b53e2197beea9454244f847?d=identicon&s=25 Sean Cribbs (seancribbs)
on 2008-12-31 14:26
(Received via mailing list)
One thing I forgot to mention.  Whenever you clone the project again,
you need to run:

$ git submodule init && git submodule update

This will make sure you download the submodules.

Sean
3c415075c9e778e2d38ebf4588a68464?d=identicon&s=25 Nate Turnage (Guest)
on 2008-12-31 18:37
(Received via mailing list)
On Wed, Dec 31, 2008 at 7:25 AM, Sean Cribbs <seancribbs@gmail.com>
wrote:

> One thing I forgot to mention.  Whenever you clone the project again, you
> need to run:
>
> $ git submodule init && git submodule update
>
> This will make sure you download the submodules.
>


Thanks for your help Sean. Now I have another related question. I am
using
the subscriber_lists extension but on my copy I changed a couple of
things.
Since I cannot use submodule to include the extension, how can I tell
git
ignore the fact that it was a cloned copy of the one on github? Or,
barring
that, how can I download a copy of the code from github (think svn
export)
to make the changes and track the code in my own repo?


Thanks,

Nate
8802b1fa1b53e2197beea9454244f847?d=identicon&s=25 Sean Cribbs (seancribbs)
on 2008-12-31 18:46
(Received via mailing list)
I would suggest forking on github, pushing up your changes to your fork,
and then creating the submodule from the fork.  If you don't want to
track other branches/forks but just keep your changes in the Radiant
project, just clone the extension (not as a submodule) and then remove
its .git directory.

Sean
3c415075c9e778e2d38ebf4588a68464?d=identicon&s=25 Nate Turnage (Guest)
on 2008-12-31 18:59
(Received via mailing list)
On Wed, Dec 31, 2008 at 11:45 AM, Sean Cribbs <seancribbs@gmail.com>
wrote:

> I would suggest forking on github, pushing up your changes to your fork,
> and then creating the submodule from the fork.  If you don't want to track
> other branches/forks but just keep your changes in the Radiant project, just
> clone the extension (not as a submodule) and then remove its .git directory.
>


Thanks. I am really not feeling the git love right now so I am going to
try
and avoid adding more complexity to my situation by starting a fork. I
did
remove the .got directory from my locally cloned copy of the
subscriber_lists extension, but when I run git submodule I keep getting
this
error:

No submodule mapping found in .gitmodules for path
'vendor/extensions/subscriber_lists'

Preceding the error, I git a list of the extensions that I have set up
as
submodules and there is one (tags) that should show up as a submodule as
well, but nothing gets past this error.

To remove the .git directory did an 'rm -rf' to remove it and a 'git rm'
just to make sure it was out of git.

Any ideas?



~Nate
3c415075c9e778e2d38ebf4588a68464?d=identicon&s=25 Nate Turnage (Guest)
on 2008-12-31 21:09
(Received via mailing list)
On Wed, Dec 31, 2008 at 11:59 AM, Nate Turnage <pixelnate@gmail.com>
wrote:

> and avoid adding more complexity to my situation by starting a fork. I did
> remove the .got directory from my locally cloned copy of the
> subscriber_lists extension, but when I run git submodule I keep getting this
> error:
>
> No submodule mapping found in .gitmodules for path
> 'vendor/extensions/subscriber_lists'



Nevermind. I hadn't done a 'git add .' and commit to add the files to
the
repo. It's working now.


Thanks,

Nate
This topic is locked and can not be replied to.