GitHub: Easiest Way to Load a Project (update)
There was a similar thread from 2013. I wonder what's changed... The method I cobbled together from various threads was: 1. Load GitFileTree (available in the Config Browser in 3.0) 2. In MC Browser, '+Repository' -> 'Remote git repository': MCFileTreeGitRemoteRepository location: 'git@github.com:rohitsukhwal/HelloWorld.git' name: 'whatever' subdirectory: '' branch: '' A few questions: 1. name: 'whatever' seems weird. I put 'whatever' because its only significance seems to be the directory to which the repo gets cloned (i.e. imageDirectory/whatever). I assume I'm missing something... 2. The following also successfully cloned the repo, but would not be accepted in MC Browser's add repo template dialog... MCFileTreeGitRepository fromZnUrl: (ZnUrl fromString: 'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git'). a) How should it be used, or not? b) Why does it clone into imageDirectory/gitHubProjectName, where #1 above clones into ./name? 3. Since Metacello can apparently load from GitHub already, for write-only repos, can that functionality be pushed into MC to be used e.g. with Gofer? The method I found seems like a lot to ask, especially e.g. if you want someone to take a quick look at a toy project with no Metacello config Ideally, as mentioned in the 2013 thread, it would be great to have: Gofer it gitHubUser: user project: project; load ----- Cheers, Sean -- View this message in context: http://forum.world.st/GitHub-Easiest-Way-to-Load-a-Project-update-tp4810309.... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
What we use for our project (we want read-write and finer control, so we have local copy of the repo from which we push back to github) ============================= Gofer new url: 'http://smalltalkhub.com/mc/Pharo/MetaRepoForPharo30/main'; configurationOf: 'GitFileTree'; loadDevelopment. Metacello new baseline: 'DynaCASE'; repository: 'gitfiletree:///my/path/to/dynacase/repository'; load. ============================= If you want to just use read-only from github, this should also work ============================= Metacello new baseline: 'SmaCC'; repository: 'github://ThierryGoubier/SmaCC'; load ============================= Peter On Sat, Mar 7, 2015 at 6:46 PM, Sean P. DeNigris <sean@clipperadams.com> wrote:
There was a similar thread from 2013. I wonder what's changed...
The method I cobbled together from various threads was: 1. Load GitFileTree (available in the Config Browser in 3.0) 2. In MC Browser, '+Repository' -> 'Remote git repository': MCFileTreeGitRemoteRepository location: 'git@github.com:rohitsukhwal/HelloWorld.git' name: 'whatever' subdirectory: '' branch: ''
A few questions: 1. name: 'whatever' seems weird. I put 'whatever' because its only significance seems to be the directory to which the repo gets cloned (i.e. imageDirectory/whatever). I assume I'm missing something... 2. The following also successfully cloned the repo, but would not be accepted in MC Browser's add repo template dialog... MCFileTreeGitRepository fromZnUrl: (ZnUrl fromString: 'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git'). a) How should it be used, or not? b) Why does it clone into imageDirectory/gitHubProjectName, where #1 above clones into ./name? 3. Since Metacello can apparently load from GitHub already, for write-only repos, can that functionality be pushed into MC to be used e.g. with Gofer? The method I found seems like a lot to ask, especially e.g. if you want someone to take a quick look at a toy project with no Metacello config
Ideally, as mentioned in the 2013 thread, it would be great to have: Gofer it gitHubUser: user project: project; load
----- Cheers, Sean -- View this message in context: http://forum.world.st/GitHub-Easiest-Way-to-Load-a-Project-update-tp4810309.... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Peter Uhnák wrote
What we use for our project
Thanks! That's a start :) The specific use case I was dealing with was a toy project with no config, hence my desire to do it via MC instead of Metacello ----- Cheers, Sean -- View this message in context: http://forum.world.st/GitHub-Easiest-Way-to-Load-a-Project-update-tp4810309p... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
with no config
Since tags and branches are handled by git and not metacello, with Baseline you need just single method BaselineOfX>>baseline: see for example https://github.com/dalehenrich/filetree/blob/gemstone2.4/repository/Baseline... or https://github.com/dynacase/dynacase/blob/master/repository/BaselineOfDynaCA... But of course this may not apply for your specific use case. Peter
Hi Sean, Le 07/03/2015 18:46, Sean P. DeNigris a écrit :
There was a similar thread from 2013. I wonder what's changed...
The method I cobbled together from various threads was: 1. Load GitFileTree (available in the Config Browser in 3.0) 2. In MC Browser, '+Repository' -> 'Remote git repository': MCFileTreeGitRemoteRepository location: 'git@github.com:rohitsukhwal/HelloWorld.git' name: 'whatever' subdirectory: '' branch: ''
A few questions: 1. name: 'whatever' seems weird. I put 'whatever' because its only significance seems to be the directory to which the repo gets cloned (i.e. imageDirectory/whatever). I assume I'm missing something...
Yes, name is not that clear. It's the name for the local repository, and I've set it so that you can work on two branches of the same repository (for example while developping filetree, work on the pharo3.0_dev and the pharo4.0_dev branches). This was to be able to merge between the two branches via MC... It was a bad idea, and its now useless due to the Merge Driver.
2. The following also successfully cloned the repo, but would not be accepted in MC Browser's add repo template dialog... MCFileTreeGitRepository fromZnUrl: (ZnUrl fromString: 'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git'). a) How should it be used, or not?
In Gofer or Monticello, you can use those Urls. For example, the following would work : Gofer it url: 'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git'; package: 'HelloWorld'; load Adding that type of Url in both Gofer and Metacello requires overrides in Zn and Metacello: ugly :(:(
b) Why does it clone into imageDirectory/gitHubProjectName, where #1 above clones into ./name?
See above about the use of 'name'...
3. Since Metacello can apparently load from GitHub already, for write-only repos, can that functionality be pushed into MC to be used e.g. with Gofer? The method I found seems like a lot to ask, especially e.g. if you want someone to take a quick look at a toy project with no Metacello config
Well, you already have the support of the GitFileTree urls in Gofer, which helps for those cases (say that protocol is https for a read-only, very fast clone with --depth=1)
Ideally, as mentioned in the 2013 thread, it would be great to have: Gofer it gitHubUser: user project: project;
But load what?
load
The main goal of GitFileTree is supporting more than github (or bitbucket): gitorious, gitlab, notabug, etc... In my opinion, Metacello + Baseline on any git repository solve the problem elegantly enough, and I'm not sure I'd like to see all the relevant gofer methods: bibucketUser:project: gitlabUser:project: (gitorious is gone...) notabugUser:project: Not forgetting that you usually want to specify the branch as well. Thierry
Thierry Goubier wrote
In Gofer or Monticello, you can use those Urls. ... I'm not sure I'd like to see all the relevant gofer methods:
Agreed! I didn't know there was any Gofer support. Your snippet (with corrected package name ;)) was just what I was looking for: Gofer it url: 'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git'; package: 'My-Spec-Tutorial'; load I ended up pushing to GitHub via the command line. Is there a way to do it from within the image? ----- Cheers, Sean -- View this message in context: http://forum.world.st/GitHub-Easiest-Way-to-Load-a-Project-update-tp4810309p... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Le 07/03/2015 20:10, Peter Uhnák a écrit :
I ended up pushing to GitHub via the command line. Is there a way to do it from within the image?
If you open the repository through Monticello Browser there are buttons 'Pull' and 'Push'. I've never tried them, but they should probably work.
They should work :). 'Pull' will do a git pull --rebase, 'Push' will do a push and be active only if there is something to push. Thierry
Thierry Goubier wrote
If you open the repository through Monticello Browser there are buttons 'Pull' and 'Push'. I've never tried them, but they should probably work. They should work :)
Push works quite nicely! Mirroring a SmalltalkHub project to GitHub is as simple as: 1. Add MC repo for the (in my case existing but code-less) GitHub repo NB: #name: in the repo creation template is the folder under imageDirectory where the local repo will go 2. Copy the versions over, just like any other MC repo 3. Push via the button in the MC repository window 4. Surf to GitHub and smile :) ----- Cheers, Sean -- View this message in context: http://forum.world.st/GitHub-Easiest-Way-to-Load-a-Project-update-tp4810309p... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Thierry Goubier wrote
Your snippet (with corrected package name ;)) was just what I was looking for: Gofer it url: 'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git'; package: 'My-Spec-Tutorial'; load
I may have spoken a tiny bit too soon. Why does the above snippet create a local filetree repo instead of a remote git repo like the following? MCFileTreeGitRemoteRepository location: 'git@github.com:rohitsukhwal/HelloWorld.git' name: 'sean' subdirectory: '' branch: ''. ----- Cheers, Sean -- View this message in context: http://forum.world.st/GitHub-Easiest-Way-to-Load-a-Project-update-tp4810309p... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Le 07/03/2015 20:12, Sean P. DeNigris a écrit :
Thierry Goubier wrote
Your snippet (with corrected package name ;)) was just what I was looking for: Gofer it url: 'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git'; package: 'My-Spec-Tutorial'; load
I may have spoken a tiny bit too soon. Why does the above snippet create a local filetree repo instead of a remote git repo like the following? MCFileTreeGitRemoteRepository location: 'git@github.com:rohitsukhwal/HelloWorld.git' name: 'sean' subdirectory: '' branch: ''.
Both are one and the same, but created via two different approaches. MCFileTreeGitRepository knows how to both link to an on-disk repo (local gitfiletree url) and to clone a remote repository... But the Monticello GUI only allow one type of creation per class of repository. So if a MCFileTreeGitRepository addition in the MC GUI opens a file dialog to select a local directory, you need another class (the MCFileTreeGitRemoteRepository) to allow you to enter the description of a remote git repository at addition. ... Thierry
Thierry Goubier wrote
Both are one and the same, but created via two different approaches.
I was confused because they appear differently in MC Browser (one shows the directory the other the github url) ----- Cheers, Sean -- View this message in context: http://forum.world.st/GitHub-Easiest-Way-to-Load-a-Project-update-tp4810309p... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Le 07/03/2015 21:10, Sean P. DeNigris a écrit :
Thierry Goubier wrote
Both are one and the same, but created via two different approaches.
I was confused because they appear differently in MC Browser (one shows the directory the other the github url)
Yes, this is something I should improve. Thierry
On 07 Mar 2015, at 19:41, Thierry Goubier <thierry.goubier@gmail.com> wrote:
For example, the following would work :
Gofer it url: 'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git'; package: 'HelloWorld'; load
Adding that type of Url in both Gofer and Metacello requires overrides in Zn and Metacello: ugly :(:(
I created an issue to study what (if anything) has to change to ZnUrl in order to help here: https://pharo.fogbugz.com/f/cases/15090/ZnUrl-should-be-able-to-better-suppo... However, the parsing works fine & correct: 'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git' asZnUrl which leads me to suspect the problem is in usage. Sven
Le 07/03/2015 20:10, Sven Van Caekenberghe a écrit :
On 07 Mar 2015, at 19:41, Thierry Goubier <thierry.goubier@gmail.com> wrote:
For example, the following would work :
Gofer it url: 'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git'; package: 'HelloWorld'; load
Adding that type of Url in both Gofer and Metacello requires overrides in Zn and Metacello: ugly :(:(
I created an issue to study what (if anything) has to change to ZnUrl in order to help here:
https://pharo.fogbugz.com/f/cases/15090/ZnUrl-should-be-able-to-better-suppo...
Thanks.
However, the parsing works fine & correct:
'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git' asZnUrl
which leads me to suspect the problem is in usage.
Well, I use ZnUrl to decode gitfiletree: urls, so I'm sure I choose a correct url scheme :) The only extension needed is the dispatch on the scheme of the url: what ZnUrl can dispatch is hardcoded as a case switch. Thierry
On 07 Mar 2015, at 21:10, Thierry Goubier <thierry.goubier@gmail.com> wrote:
Le 07/03/2015 20:10, Sven Van Caekenberghe a écrit :
On 07 Mar 2015, at 19:41, Thierry Goubier <thierry.goubier@gmail.com> wrote:
For example, the following would work :
Gofer it url: 'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git'; package: 'HelloWorld'; load
Adding that type of Url in both Gofer and Metacello requires overrides in Zn and Metacello: ugly :(:(
I created an issue to study what (if anything) has to change to ZnUrl in order to help here:
https://pharo.fogbugz.com/f/cases/15090/ZnUrl-should-be-able-to-better-suppo...
Thanks.
However, the parsing works fine & correct:
'gitfiletree://github.com/rohitsukhwal/HelloWorld.git?protocol=git' asZnUrl
which leads me to suspect the problem is in usage.
Well, I use ZnUrl to decode gitfiletree: urls, so I'm sure I choose a correct url scheme :) The only extension needed is the dispatch on the scheme of the url: what ZnUrl can dispatch is hardcoded as a case switch.
Thierry
Then the problem is in the extension protocol *gofer-core-accessing - for me that is not ZnUrl itself ;-) That being said, I totally agree the code is ugly there, what is the solution ? Doing a subclass based lookup below MCRepository ? Who wants to handle this URL ? Sven
Le 08/03/2015 00:37, Sven Van Caekenberghe a écrit :
Then the problem is in the extension protocol *gofer-core-accessing - for me that is not ZnUrl itself ;-)
That being said, I totally agree the code is ugly there, what is the solution ?
Doing a subclass based lookup below MCRepository ? Who wants to handle this URL ?
I'd like that. Simple and not very complex. I had a look into which methods I extend in Zn, and for some of them, it looks like very small changes. I'll make a slice as soon as I get to it. Thierry
participants (4)
-
Peter Uhnák -
Sean P. DeNigris -
Sven Van Caekenberghe -
Thierry Goubier