[Glass] Migrating to github
Dale Henrichs via Glass
glass at lists.gemtalksystems.com
Wed Aug 26 09:54:58 PDT 2015
On 08/24/2015 06:12 PM, BrunoBB via Glass wrote:
> Hi,
>
> I'm trying to migrate my packages from SS3 to Github.
How exciting!
Before we get into the details of doing anything with tODE I am curious
if you are interested in preserving your entire project (mcz package)
history in git or is it sufficient to switch your current project state
to git ...
It _is_ possible to create a git repository from an mcz repository in
such a way that the mcz history is reflected in the git commit history.
Several folks have tackled this with good results and if you are
interested in doing this I can track down the information ... It is
important to consider this at an early stage ... for me it has been
sufficient to just do new development in git ...
> As far as i read it i have to create a project entry (Git) to save my
> packages locally and commit all changes to local disk and the push these
> changes into Git. Is this right ?
Yes this is the proper model.
> The following command:
> project entry --git=projectHome --repo=$GS_HOME /home/persistence-api
>
> Answer an error:
> Topez ERROR: a TodeCommandError occurred (error 121000), Unknown option: git
This is (obviously) a bug in tODE (and I have just submitted a bug
report[1]), but also a miscommunication on my part. Improving the man
page for the `project` family of commands is still on my todo list:)
On the `man project entry` page I mention that there are two types of
projects:
"There are two basic types of project entry: Git and Metacello"
But I do not further distinguish when you should use one type over the
other. A "Git" project is intended to refer to a "pure git project" or a
project that does not have any smalltalk code ... For storing smalltalk
code (your use case) you want to use a "Metacello" project.
So for loading/managing a project with tODE you will use either `project
--config` or `project --baseline`, which do work in tODE.
With that said, since you are moving to git from ss3, I recommend that
you create a baseline. It is straightforward to convert a
ConfigurationOf to a a BaselineOf, see the section on "Create
Baseline"[1] in the "Getting Started with GitHub" doc[3] for Metacello.
Feel free to ask questions ... Paul Debruicker is working on a utility
for automatically converting a ConfgirationOf to a BaselineOf - so he
can chime in ...
Unfortunately I don't have a `create new project` or a `convert new
project` command written, but these are the basic steps (assuming you
are NOT preserving the entire mcz history in git; assuming that you are
using a BaselineOf - which you will create) ... (The following commands
are based on using the latest commit in the dev branch of tODE and
GsDevKitHome ... and if you aren't already using the dev branches ping
for additional instructions):
1. create GitHub project (done:
https://github.com/brunobuzzi/OrbeonPersistenceLayer)
2. create a local git repository (using `git init` in an empty directory
called
OrbeonPersistenceLayer). In the dev branch of GsDevKitHome, the
place to put shared
git repositories is $GS_HOME/tode/sys/local/git (using bash):
mkdir $GS_HOME/tode/sys/local/git/OrbeonPersistenceLayer
mkdir $GS_HOME/tode/sys/local/git/OrbeonPersistenceLayer/repository
3. copy each of the active packages from the SS3 repo to your local git
repo:
mc copy Orbeon_Persistence_API-BrunoBB-0.039
http://ss3.gemtalksystems.com/ss/OrbeonPersistenceAPI
filetree://$GS_HOME/tode/sys/local/git/OrbeonPersistenceLayer/repository
mc copy Orbeon_Persistence-BrunoBB-0.019
http://ss3.gemtalksystems.com/ss/OrbeonPersistenceAPI
filetree://$GS_HOME/tode/sys/local/git/OrbeonPersistenceLayer/repository
4. create a BaselineOfOrbeonPersistenceLayer class:
cls create BaselineOfOrbeonPersistenceLayer BaselineOf
BaselineOfOrbeonPersistenceLayer
cls protocol --add=BaselineOfOrbeonPersistenceLayer baseline
browse class BaselineOfOrbeonPersistenceLayer
5. add a baseline: method to BaselineOfOrbeonPersistenceLayer that looks
something like the following (no tODE command - sorry:):
baseline: spec
<baseline>
spec
for: #'common'
do: [
spec
package: 'Orbeon_Persistence';
package: 'Orbeon_Persistence_API' with: [ spec requires:
'Orbeon_Persistence' ];
yourself.
spec
group: 'default' with: #('Core');
group: 'Core' with: #('Orbeon_Persistence_API');
yourself ].
6. create a BaselineOfOrbeonPersistenceLayer package
mc create BaselineOfOrbeonPersistenceLayer
7. associate the filetree repo with the new package:
mr add
filetree://$GS_HOME/tode/sys/local/git/OrbeonPersistenceLayer/repository
BaselineOfOrbeonPersistenceLayer
8. save the baseline to the repo:
mc commit BaselineOfOrbeonPersistenceLayer `initial baseline and
packages`
9. Create the project entry:
project entry --baseline=OrbeonPersistenceLayer
--repo=filetree://$GS_HOME/tode/sys/local/git/OrbeonPersistenceLayer/repository
/sys/stone/projects
10. Load the project (testing your baseline):
project load OrbeonPersistenceLayer
11. Write the new baseline to the filetree repository and do a git commit:
project commit --git --message=`initial commit for project packages
and baseline` OrbeonPersistenceLayer
project list
12. Hook up your local git repo to your github repo something like the
following (follow github instructions to get it exactly right):
git remote add origin
git at github.com:brunobuzzi/OrbeonPersistenceLayer.git
git push origin master
... and I think that's it... Let me know how things work for you. I've
create a gist on github[4] with all of the tode comands extracted out
(source code is in middle) for easy copy/paste.
Dale
[1] https://github.com/dalehenrich/tode/issues/188
[2]
https://github.com/dalehenrich/metacello-work/blob/master/docs/GettingStartedWithGitHub.md#create-baseline
[3]
https://github.com/dalehenrich/metacello-work/blob/master/docs/GettingStartedWithGitHub.md
[4] https://gist.github.com/dalehenrich/001ab961bd599b3efac1
More information about the Glass
mailing list