Pharo project on Git
Asked Answered
V

2

8

I am a begginer with Pharo, and I have learnt about Monticello and Metacello.

As far as I understand, Pharo not being file-based means that one cannot use common source control tools such as Git directly. Yet I see some Pharo repositories on Github, such as this one.

Is it possible to back up the cello versioning on Git? How such a workflow would look like?

Verdellverderer answered 8/9, 2014 at 10:34 Comment(0)
B
5

First of all welcome to Pharo and I hope you enjoy your stay and find it very productive and fun :)

Its possible because first of all you have the option to export your code to a file using a fileout action and you can also do the opposite, import your code back to Pharo with a filein. The problem is that since fileout works per class its quite some manual work. But I have tried this approach and works with git and github.

Of course you quickly will want to automate the generation of files and this is where filetree comes to play. It basically brakes down not just classes but even your methods (class and instance) to files. Everything is nicely organized inside a single folder with each class getting its own subfolder and each method its own st file which is a regular text file as you would expect from any source code file.

gitfiletree that Damien mentions is basically a client for git like magit is for emacs or smartgit. It allows you to use monticello gui to do your git commits, though you still need a terminal to push. The disadvantage of gitfiletree is that it does not work for windows because the OSProcess which a library that allows Pharo to call command line application (which is what git really is) does not work for Windows just yet but its a matter of time.

So if you already familiar and use git for the terminal you dont need gitfiletree anyway and all you need if filetree.

Its not hard per se for a begineer but it could be challenging but unlike Damien I would not discourage especially if you already familiar with git and github.

You can find more information in the Pharo for the Enterprise Book in the chapter Git for Pharo

Pharo for The Enterprise

I use gitfiletree in macos, for my project Ephestos. So far it goes well and I have little reason to switch back to smalltalkhub.

Binns answered 8/9, 2014 at 11:22 Comment(4)
Thank you very much. I am quite happy with Monticello and Metacello, but I thought that if I am doing something opensource, it would be nice to publish it on my github as well.Verdellverderer
nothing stopping you but bare in mind that gitfiletree and git integration to Pharo is a new thing so you may experience the occasional bug and the interface is not that polished as it is a work in progress. Saying that because we had several problem with smalltalkhub more and more people move to Github. So I think its a matter of time before Pharo smoothly integrates with git. I may also start contributing to gitfiletree myself as I am a big fan of both git and github. My experience so far with simple commits looks ok with no major problems. In windows I use just filetree and git bash .Binns
I would strongly discourage a smalltalk beginner to use git and github now. The quality of the tooling is simply not acceptable yet. The kind of problems you might need to fix are definitely outside beginner range. We expect that to change fast, please check the pharo mailing list to see when the tools are ready.Kauri
@Binns the book's link is broken. Is this the book?Impermeable
P
3

it is indeed possible to use git from Monticello to version your source code: the tools are filetree, gitfiletree and gitfiletree merge driver. Nevertheless, these tools are not ready for everyone's consumption. There is no well established workflow. As such, I strongly discourage you, as a beginner with Pharo, to use any of these tools yet.

Portie answered 8/9, 2014 at 10:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.