I started to tweak Squeak classes to make them perform what is the best behaviour for me. In particular I added a message: MCGitRepository>>gitCommandWithOutput
and I modified another: MCRemoteGitRepository>>basicStoreVersion
.
I saved the image. I will have my changes working next time I boot Squeak. ok.
Now, suppose I want to save my changes and load them tomorrow in a new Squeak image. Or move them to another computer.
I have my own myClass
to add methods to existing classes but, in this case, I need also to change an existing message,
MCRemoteGitRepository>>basicStoreVersion
.
What is the best practice in Smalltalk for this situation ?
P.S. Metacello
& Metacello-git
which I am tweaking, live in GitHub. Please don't focus this fact. Suppose I want to change Regex-Core
or something else which comes from Squeaksource, Squeakmap or else. So, we can't assume I am modifying something coming from Git.
You can either maintain your overrides/extensions to the base image (and packages from other sources) in changeset(s) or package(s). Changesets are the simplest approach but they can get somewhat cumbersome to maintain as they evolve over time. For that reason, I would recommend using packages.
To make a method (whether one you added or a method override) part of one of your own packages, just change the category of the method using the Browser. For example, to change the package that MCRemoteGitRepository>>basicStoreVersion
belongs to:
more...
change category...
new...
then click Choose
Accept
Before discarding your working image, be sure to save your package. Then all you need to do is load your package(s) into a fresh image to incorporate your changes.