Putting custom code in a separate repository

2013-09-09 Thread David Suna
I started a project locally by cloning the git repository for CakePHP 
(branch 2.4). I would like to maintain the ability to do a pull on the git 
repository to get any updates as new releases are put out.  I assume I 
should be on branch 2.4 rather than on master.

I would also like to have my code in a separate repository.  That includes 
any changes I made to files that come as part of the CakePHP repository (so 
far this includes app/Config/bootstrap.php, app/Config/core.php, 
app/Config/routes.php and app/Controller/AppController.php) as well as 
files that I have added (i.e. everything under Config, Controller, Model, 
Test, View and webroot).

There are also Plugins that have been retrieved from other repositories but 
since those are contained under a single directory that isn't a problem to 
maintain.

Does anyone have a recommendation as to how to go about doing this?

Thanks.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Putting custom code in a separate repository

2013-09-09 Thread Jeremy Burns : Class Outfit
Check out Git submodules - that's exactly what they are for.


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 9 Sep 2013, at 14:17, David Suna david.s...@gmail.com wrote:

 I started a project locally by cloning the git repository for CakePHP (branch 
 2.4). I would like to maintain the ability to do a pull on the git repository 
 to get any updates as new releases are put out.  I assume I should be on 
 branch 2.4 rather than on master.
 
 I would also like to have my code in a separate repository.  That includes 
 any changes I made to files that come as part of the CakePHP repository (so 
 far this includes app/Config/bootstrap.php, app/Config/core.php, 
 app/Config/routes.php and app/Controller/AppController.php) as well as files 
 that I have added (i.e. everything under Config, Controller, Model, Test, 
 View and webroot).
 
 There are also Plugins that have been retrieved from other repositories but 
 since those are contained under a single directory that isn't a problem to 
 maintain.
 
 Does anyone have a recommendation as to how to go about doing this?
 
 Thanks.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Putting custom code in a separate repository

2013-09-09 Thread David Suna
Thanks for the suggestion.

From a quick look at git submodules it seems that they are geared to using 
them in a single directory.  The changes to a clean CakePHP installation 
end up being across multiple directories as well as include changes to some 
of the files in the original CakePHP repository.  I didn't see how 
submodules would handle that situation.  Do you have a reference that would 
explain this more?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Putting custom code in a separate repository

2013-09-09 Thread Simon Males
Some people have made lib/Cake a submodule

https://github.com/nodesagency/cakephp-lib

Another suggestion is too have cakephp/cakephp as an remote named
'upstream'. Then you could suck in changes via `git fetch upstream`, but it
could get messy in the app directory.


On Mon, Sep 9, 2013 at 9:48 PM, David Suna david.s...@gmail.com wrote:

 Thanks for the suggestion.

 From a quick look at git submodules it seems that they are geared to using
 them in a single directory.  The changes to a clean CakePHP installation
 end up being across multiple directories as well as include changes to some
 of the files in the original CakePHP repository.  I didn't see how
 submodules would handle that situation.  Do you have a reference that would
 explain this more?

  --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
Simon Males

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Putting custom code in a separate repository

2013-09-09 Thread Jeremy Burns : Class Outfit
You add submodules in a path relative to the root of the git repository. I am a 
Git command line coward so use SourceTree (http://sourcetreeapp.com) which does 
it all for me. I have all (most) of my plugins as submodules.

On 9 Sep 2013, at 14:48, David Suna david.s...@gmail.com wrote:

 Thanks for the suggestion.
 
 From a quick look at git submodules it seems that they are geared to using 
 them in a single directory.  The changes to a clean CakePHP installation end 
 up being across multiple directories as well as include changes to some of 
 the files in the original CakePHP repository.  I didn't see how submodules 
 would handle that situation.  Do you have a reference that would explain this 
 more?
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Putting custom code in a separate repository

2013-09-09 Thread David Suna

On Monday, September 9, 2013 4:58:06 PM UTC+3, Simon Males wrote:

 Some people have made lib/Cake a submodule

 https://github.com/nodesagency/cakephp-lib


This sounds like it would work although it is somewhat of a shame to leave 
out all the code under app. My question would be how to get started.  If I 
just clone the cakephp-lib where do I get the code under app from? Take it 
from a zip file?

Another suggestion is too have cakephp/cakephp as an remote named 
 'upstream'. Then you could suck in changes via `git fetch upstream`, but it 
 could get messy in the app directory.

 
As the app directory is what I am most interested in I don't think I want 
to go for messy. 

-- 
 Simon Males 


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Putting custom code in a separate repository

2013-09-09 Thread David Suna

On Monday, September 9, 2013 5:05:04 PM UTC+3, Jeremy Burns : 
class...@classoutfit.com wrote:

 You add submodules in a path relative to the root of the git repository. I 
 am a Git command line coward so use SourceTree (http://sourcetreeapp.com) 
 which does it all for me. I have all (most) of my plugins as submodules.

 Yes - this approach would work well for plugins as they have their own 
directory structure and everything for a plugin is contained below one 
parent directory. However, for general Cake code (i.e. models, views and 
controllers) there is no isolated directory point under which all of these 
would be done.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Putting custom code in a separate repository

2013-09-09 Thread Rachman Chavik
On Mon, 09 Sep 2013 06:48:42 -0700, David Suna wrote:

 Thanks for the suggestion.
 
 From a quick look at git submodules it seems that they are geared to using 
 them in a single directory.  The changes to a clean CakePHP installation 
 end up being across multiple directories as well as include changes to some 
 of the files in the original CakePHP repository.  I didn't see how 
 submodules would handle that situation.  Do you have a reference that would 
 explain this more?

You can leave out Cakephp from the app repo.  But if you want to use submodule,
there are a few options, this is how I do it for 2.x based project:

- initialize your skeleton project. This is where you do your work.

/path/to/Console/cake bake project foo
cd foo
git init
git add -A
git commit

- setup a submodule for cake in Vendor

git submodule add git://github.com/cakephp/cakephp Vendor/cakephp
  
  So, CAKE_CORE_INCLUDE_PATH will be foo/Vendor/cakephp/lib.  So you would need 
  to adjust foo/Config/bootstrap and foo/Console/cake so that it knows where to 
look.

Or just don't put cake in your repo at all.  And tell your 'foo' project the 
location
of Cake.  There are a few ways of doing this:
  * setup cake in php.ini include_path (not recommended, since it will be 
difficult to run
different versions of cake easily)
  * create a symlink from your project, eg: foo/../lib/Cake - 
/path/to/cake/lib/Cake

Note:

When working with submodules, I recomment to use a recent git. Quite a few 
improvements
were added to ease its management.

For 3.x, the recommended way of doing this will be with composer.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.