Tell metacello that a github repository is already cloned

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Tell metacello that a github repository is already cloned

Guillermo Polito
Hi Dale,

I've already a clone on disk, and I have several baselines that depend on the github repository that I've cloned. That is, in my dependencies I have urls like:

 github://...

When I load my dependent baselines, I want that they go and look for my clone instead of refetching everything. So what I'd like is to tell Metacello at some point something like:

hey Metacello this repo "github://..." is in here "/Users/..."!

I do not want to update all my baselines to have a filetree dependency that hardcodes a path in my disk.

Is there a way to do this? Maybe I need to update Metacello? I could not find any docs online, nor reading the code in the image. I was searching the metacello docs on github, but probably I was looking in the wrong place also...

Thanks,
Guille

--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tell metacello that a github repository is already cloned

Guillermo Polito
Looks like I can do this:

MCGitHubRepository new
directory: 'mypath';
projectPath: 'repo'
projectVersion: 'version'
repoPath: 'source_path_in_repo'

But I need to register that repository somewhere yet to be found by metacello :)

On Tue, Aug 15, 2017 at 9:30 AM, Guillermo Polito <[hidden email]> wrote:
Hi Dale,

I've already a clone on disk, and I have several baselines that depend on the github repository that I've cloned. That is, in my dependencies I have urls like:

 github://...

When I load my dependent baselines, I want that they go and look for my clone instead of refetching everything. So what I'd like is to tell Metacello at some point something like:

hey Metacello this repo "github://..." is in here "/Users/..."!

I do not want to update all my baselines to have a filetree dependency that hardcodes a path in my disk.

Is there a way to do this? Maybe I need to update Metacello? I could not find any docs online, nor reading the code in the image. I was searching the metacello docs on github, but probably I was looking in the wrong place also...

Thanks,
Guille

--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: <a href="tel:+33%206%2052%2070%2066%2013" value="+33652706613" target="_blank">+33 06 52 70 66 13




--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tell metacello that a github repository is already cloned

Guillermo Polito
And I arrived to this:

MetacelloPlatform >> createRepository: aRepositorySpec
...
  Smalltalk
    at: #'MCGitHubRepository'
    ifPresent: [ :cl | 
      type = 'github'
        ifTrue: [ ^ cl location: aRepositorySpec description ] ].
...

But there is apparently no lookup for existing repositories in the version I have :/

On Tue, Aug 15, 2017 at 9:43 AM, Guillermo Polito <[hidden email]> wrote:
Looks like I can do this:

MCGitHubRepository new
directory: 'mypath';
projectPath: 'repo'
projectVersion: 'version'
repoPath: 'source_path_in_repo'

But I need to register that repository somewhere yet to be found by metacello :)

On Tue, Aug 15, 2017 at 9:30 AM, Guillermo Polito <[hidden email]> wrote:
Hi Dale,

I've already a clone on disk, and I have several baselines that depend on the github repository that I've cloned. That is, in my dependencies I have urls like:

 github://...

When I load my dependent baselines, I want that they go and look for my clone instead of refetching everything. So what I'd like is to tell Metacello at some point something like:

hey Metacello this repo "github://..." is in here "/Users/..."!

I do not want to update all my baselines to have a filetree dependency that hardcodes a path in my disk.

Is there a way to do this? Maybe I need to update Metacello? I could not find any docs online, nor reading the code in the image. I was searching the metacello docs on github, but probably I was looking in the wrong place also...

Thanks,
Guille

--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: <a href="tel:+33%206%2052%2070%2066%2013" value="+33652706613" target="_blank">+33 06 52 70 66 13




--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: <a href="tel:+33%206%2052%2070%2066%2013" value="+33652706613" target="_blank">+33 06 52 70 66 13




--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tell metacello that a github repository is already cloned

gcotelli
Checkout https://gist.github.com/gcotelli/d4521656358786ae2aca12a70478980f . I do something like you want to avoid downloading from GitHub all the time.

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tell metacello that a github repository is already cloned

Guillermo Polito
Thanks for answering.

I saw that yesterday while googling. But, how do you manage dependencies? I want to do that at the level of a baseline.

spec package: ' with: [  spec requires: 'ble'; repository: 'github://...' ].

If I have to load dependencies by hand that would defeat the purpose of a baseline, in that case I use normal script :)

On Wed, Aug 16, 2017 at 3:30 AM, Gabriel Cotelli <[hidden email]> wrote:
Checkout https://gist.github.com/gcotelli/d4521656358786ae2aca12a70478980f . I do something like you want to avoid downloading from GitHub all the time.

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tell metacello that a github repository is already cloned

gcotelli
I 've let the baseline with the GitHub urls and lock the projects I have cloned to the local copies. If your top level project loads in the baseline all the required dependencies you just need to load that one.

I'm doing several loads just because the groups don't load the development versions of the dependencies and I'm developing all this projects simultaneously.

If you need more help let me know and we can chat about it in disccord tomorrow.

On Aug 15, 2017 22:36, "Guillermo Polito" <[hidden email]> wrote:
Thanks for answering.

I saw that yesterday while googling. But, how do you manage dependencies? I want to do that at the level of a baseline.

spec package: ' with: [  spec requires: 'ble'; repository: 'github://...' ].

If I have to load dependencies by hand that would defeat the purpose of a baseline, in that case I use normal script :)

On Wed, Aug 16, 2017 at 3:30 AM, Gabriel Cotelli <[hidden email]> wrote:
Checkout https://gist.github.com/gcotelli/d4521656358786ae2aca12a70478980f . I do something like you want to avoid downloading from GitHub all the time.

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

--
You received this message because you are subscribed to a topic in the Google Groups "Metacello" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/metacello/joWb4Fsw0eM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tell metacello that a github repository is already cloned

Dale Henrichs-3
In reply to this post by Guillermo Polito

Guillermo,

I didn't see this thread until now. Gabriel is making the same suggestion that I would make: use the `lock` command ...

In a later message you mention that you want to load each package from a different repository in a single baseline? I don't quite understand the rationale of wanting to have a system where a developer has to explicitly manage the version of each package ... The idea of using git, is that all of the packages are at the same "version" and it becomes unnecessary to manage individual package versions like it is with Monticello and ConfgurationOf ... all of the packages committed together are intended to work together and there is no need to version each package separately ...

If you want to separately version packages then you need to put them in separate git repositories and manage them as separate Metacello projects ...

Dale


On 8/15/17 12:30 AM, Guillermo Polito wrote:
Hi Dale,

I've already a clone on disk, and I have several baselines that depend on the github repository that I've cloned. That is, in my dependencies I have urls like:

 github://...

When I load my dependent baselines, I want that they go and look for my clone instead of refetching everything. So what I'd like is to tell Metacello at some point something like:

hey Metacello this repo "github://..." is in here "/Users/..."!

I do not want to update all my baselines to have a filetree dependency that hardcodes a path in my disk.

Is there a way to do this? Maybe I need to update Metacello? I could not find any docs online, nor reading the code in the image. I was searching the metacello docs on github, but probably I was looking in the wrong place also...

Thanks,
Guille

--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tell metacello that a github repository is already cloned

Guillermo Polito


On Wed, Aug 16, 2017 at 4:49 AM, Dale Henrichs <[hidden email]> wrote:

Guillermo,

I didn't see this thread until now. Gabriel is making the same suggestion that I would make: use the `lock` command ...

Cool, so #lock is what I have to check.

In a later message you mention that you want to load each package from a different repository in a single baseline? I don't quite understand the rationale of wanting to have a system where a developer has to explicitly manage the version of each package ... The idea of using git, is that all of the packages are at the same "version" and it becomes unnecessary to manage individual package versions like it is with Monticello and ConfgurationOf ... all of the packages committed together are intended to work together and there is no need to version each package separately ...

Sorry, it was 3:30 am :) I meant project. I wanted to have a project with a github dependency, but I already had the dependency cloned and I wanted to use that one.
 

If you want to separately version packages then you need to put them in separate git repositories and manage them as separate Metacello projects ...

Actually, my case is that I have several baselines in the same git repository. And what I want is that some of them reference themselves. Sadly that is a requirement for now, I cannot split the baselines in different packages :/

Thanks! I'll come back if locking works good to share!
 

Dale


On 8/15/17 12:30 AM, Guillermo Polito wrote:
Hi Dale,

I've already a clone on disk, and I have several baselines that depend on the github repository that I've cloned. That is, in my dependencies I have urls like:

 github://...

When I load my dependent baselines, I want that they go and look for my clone instead of refetching everything. So what I'd like is to tell Metacello at some point something like:

hey Metacello this repo "github://..." is in here "/Users/..."!

I do not want to update all my baselines to have a filetree dependency that hardcodes a path in my disk.

Is there a way to do this? Maybe I need to update Metacello? I could not find any docs online, nor reading the code in the image. I was searching the metacello docs on github, but probably I was looking in the wrong place also...

Thanks,
Guille

--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tell metacello that a github repository is already cloned

Guillermo Polito
Yay! locking worked as I wanted!

The only "drawback" is that I had to lock all my dependent projects before loading my top project.

Metacello new
baseline: 'X';
repository: 'filetree://../src';
lock.

Metacello new
baseline: 'Y';
repository: 'filetree://../src';
lock.

Metacello new
baseline: 'Top';
repository: 'filetree://../src';
onLock: [:lock | lock honor];
load.

At least this allows my baselines be clean and have correct urls instead of relative paths :).

BTW, what I'm setting up looks like a multi-project from other systems. I'm thinking it would be nice to have some kind of support for that: I describe a main project (a baseline) and subprojects (other baselines) and I'd like to automatically lock all sub-projects before loading. Does something like that exist?

Maybe also this could be solved using paths and would be not so bad. The thing is that a filetree path inside a baseline should be evaluated relative to the baseline's location and not to my working directory as it is right now.

Thoughts?

Thanks again!
Guille

On Wed, Aug 16, 2017 at 9:47 AM, Guillermo Polito <[hidden email]> wrote:


On Wed, Aug 16, 2017 at 4:49 AM, Dale Henrichs <[hidden email]> wrote:

Guillermo,

I didn't see this thread until now. Gabriel is making the same suggestion that I would make: use the `lock` command ...

Cool, so #lock is what I have to check.

In a later message you mention that you want to load each package from a different repository in a single baseline? I don't quite understand the rationale of wanting to have a system where a developer has to explicitly manage the version of each package ... The idea of using git, is that all of the packages are at the same "version" and it becomes unnecessary to manage individual package versions like it is with Monticello and ConfgurationOf ... all of the packages committed together are intended to work together and there is no need to version each package separately ...

Sorry, it was 3:30 am :) I meant project. I wanted to have a project with a github dependency, but I already had the dependency cloned and I wanted to use that one.
 

If you want to separately version packages then you need to put them in separate git repositories and manage them as separate Metacello projects ...

Actually, my case is that I have several baselines in the same git repository. And what I want is that some of them reference themselves. Sadly that is a requirement for now, I cannot split the baselines in different packages :/

Thanks! I'll come back if locking works good to share!
 

Dale


On 8/15/17 12:30 AM, Guillermo Polito wrote:
Hi Dale,

I've already a clone on disk, and I have several baselines that depend on the github repository that I've cloned. That is, in my dependencies I have urls like:

 github://...

When I load my dependent baselines, I want that they go and look for my clone instead of refetching everything. So what I'd like is to tell Metacello at some point something like:

hey Metacello this repo "github://..." is in here "/Users/..."!

I do not want to update all my baselines to have a filetree dependency that hardcodes a path in my disk.

Is there a way to do this? Maybe I need to update Metacello? I could not find any docs online, nor reading the code in the image. I was searching the metacello docs on github, but probably I was looking in the wrong place also...

Thanks,
Guille

--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: <a href="tel:+33%206%2052%2070%2066%2013" value="+33652706613" target="_blank">+33 06 52 70 66 13




--

   

Guille Polito


Research Engineer

French National Center for Scientific Research - http://www.cnrs.fr



Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tell metacello that a github repository is already cloned

Guillermo Polito
In reply to this post by Guillermo Polito

If you want to separately version packages then you need to put them in separate git repositories and manage them as separate Metacello projects ...

Actually, my case is that I have several baselines in the same git repository. And what I want is that some of them reference themselves. Sadly that is a requirement for now, I cannot split the baselines in different packages :/
 
I correct myself, it is too early and I did not sleep well. I cannot split baselines in different **repositories**

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Tell metacello that a github repository is already cloned

Dale Henrichs-3
In reply to this post by Guillermo Polito



On 8/16/17 2:15 AM, Guillermo Polito wrote:
Yay! locking worked as I wanted!
I'm glad that you finally found it:)

The only "drawback" is that I had to lock all my dependent projects before loading my top project.

Metacello new
baseline: 'X';
repository: 'filetree://../src';
lock.

Metacello new
baseline: 'Y';
repository: 'filetree://../src';
lock.

Metacello new
baseline: 'Top';
repository: 'filetree://../src';
onLock: [:lock | lock honor];
load.
Well, you do have to arrange to have the projects cloned before you load them as well ... in tODE I have some disk-based artifacts that are created when a project is cloned locally and every image (in an image cluster) looks in a known location and those projects are automatically locked when the image is loaded, so manual locking is not needed ... I talk about these things in my Smalltalks 2016 talk on "Dangerous Liaisons: Smalltalk, Files, and Git"[1]. Perhaps now that you are working with local git clones the talk will make a bit more sense:)

[1] https://www.youtube.com/watch?v=Ejmqs0xLvSk&index=25&list=PLCGAAdUizzH06AkHg6_UxZ6QZBgz84yAc

At least this allows my baselines be clean and have correct urls instead of relative paths :).

BTW, what I'm setting up looks like a multi-project from other systems. I'm thinking it would be nice to have some kind of support for that: I describe a main project (a baseline) and subprojects (other baselines) and I'd like to automatically lock all sub-projects before loading. Does something like that exist?
I consider that this a tools issue ... and like I said, I a solution that I put in place for tODE ... these files are downloadable from a web-site ... I use gh-pages for the GsDevKit "project entries"[2]. Take a look at the individual project entry files[3] and you'll see that there are project level  install script hooks that can be used to clone dependent projects ... the `project clone` command doesn't clone a project that has been previously clones ...

[2] https://github.com/GsDevKit/GsDevKit_home/tree/gh-pages
[3] https://github.com/GsDevKit/GsDevKit_home/blob/gh-pages/Metacello.ston

Maybe also this could be solved using paths and would be not so bad. The thing is that a filetree path inside a baseline should be evaluated relative to the baseline's location and not to my working directory as it is right now.
Yeah, I think that locks should be used to reference local clones of projects ... if you look at the presentation and the slides you will see that there needs to be a least two well-known locations (cluster and image)  for being able to share a local clone amongst a group of images, but also allow for an image to have a "private" clone of a project ... this is all supported in tODE and would need to be built up as a set of tools for Pharo to provide similar capabilities ...

I would like to eventually standardize on the contents of the project entries ... the .smalltalk.ston files for SmalltalkCI[4] have some nice features and capabilities that aren't in my project entries[3] and my project entries have some features that aren't in the .smalltalk.ston files either ... and I think that a common format and information is critical ... since as you point out there is the need for a specification that can be shared and applied before any baselines are loaded ...

[4] https://github.com/dalehenrich/tode/blob/master/.smalltalk.ston

Dale

--
You received this message because you are subscribed to the Google Groups "Metacello" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.