Skip to content

Instantly share code, notes, and snippets.

View dalehenrich's full-sized avatar

Dale Henrichs dalehenrich

View GitHub Profile
dalehenrich /
Created February 23, 2012 10:02
Sample of Metacello Scripting API
"download HEAD of master branch of the sample project, i.e., download from github, but don't load Sample project into image"
Metacello new
project: 'Sample';
repository: 'github://dalehenrich/sample:master/core';
"load HEAD of master branch of the sample project, i.e., download from github, and load Sample project into image"
Metacello new
project: 'Sample';
repository: 'github://dalehenrich/sample:master/core';
dalehenrich /
Created February 23, 2012 10:19
Proposed Smalltalk project directory structure

##Monticello Package Structure

The basic idea is to store individual methods in files so that git can manage method-level history. The split between classes and extensions in the snapshot directory is differentiate between classes defined in a package and extension methods defined in the package:

  | +-classes\
  | | +-SampleCore.class\
  | |
dalehenrich /
Created February 23, 2012 10:45
Answer the question: How do I edit specs for a project stored in git?
'From Pharo1.3 of 16 June 2011 [Latest update: #13315] on 23 February 2012 at 2:38:04 am'!
Object subclass: #MetacelloProjectSpecifications
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'MetacelloProjectSpecifications'!
!MetacelloProjectSpecifications methodsFor: 'Sample.source' stamp: 'dkh 2/23/2012 02:34'!
core: spec
<project: 'Sample.source' package: 'Core.pkg'>
dalehenrich /
Created February 23, 2012 17:36
List of assumptions about using git for managing Smalltalk source
  1. I assume that by moving to a disk-based structure, we are expecting folks to edit and modify directory structure on disk using the shell and standard editors. This means that all information is going to be stored in plain test files. No binary files. Binary files may be stored in the project structure for use by developers, but the mechanisms for loading code into an image from disk must not involve binary files.

  2. I assume that we will preserve package structure on disk. This means that at a minimum we must be able to preserve the collection of class and method definitions that make up a Monticello package. This includes traits and any other standard definitions that are currently present in a Monticello package. In practice "preserving the package structure" means that one can load a package from disk and then save the package to disk in another location and the directory structure is "identical". The package loader must be respectful of files and directories that are not part of the official package

dalehenrich /
Created February 23, 2012 17:51
Bootstrap git support into a Pharo image
"Note that the the git work has not even achieved alpha, yet, so don't
bootstrap into an image that you care about:)
Assuming Pharo 1.3"
"Bootstrap filetree code"
Gofer new
url: '';
package: 'ConfigurationOfFileTree';
dalehenrich /
Created February 23, 2012 22:05
mac to foos and back
Metacello new
project: 'Metacello';
repository: 'filetree:///opt/git/metacello/repository/';
MetacelloFileTreeConstructor writeJsonFor:'/opt/git/metacello/repository/metacello/Metacello'.
"current target ... make sure that loadedProjects looks right ... getting nil versions in some cases, so it needs work"
Metacello resetLoadedProjects.
dalehenrich /
Created February 24, 2012 19:16
Project overview (starts as email message to Sebastian Sastre)

The project is aimed at making it possible for Smalltalkers to use git/svn/mercurial for project/source version control. There is special emphasis on git and github because github provides distributed repositories and and number of very useful features that enhance the development process.

I started this project when I recently realized that it wasn't as hard to do this as I had thought in the past...

Right now the project is based on Metacello, where I am adding a scripting API to Metacello, like Gofer, but aimed at project level operations not package level operations.

Here's a list of sample Metacello scripting API expressions [1].

Here's the directory structure that I'm proposing to be used for Smalltalk projects[2].

dalehenrich /
Created February 27, 2012 04:11
Why bother with git at all?


You are not a party pooper ... these are exactly the kinds of questions I'm looking for They are excellent questions.

I'm going to highlight several of your points and then answer:

"keeping the Monticello and git metadata in sync. For example since it's still Monticello there has to be all the Monticello metadata which is laying around in "strange" files ... makes it quite unlikely that you can edit the source with a

dalehenrich /
Created March 2, 2012 19:27
Replace repositoryGroups for workingCopies with filetree: equivalent
"cd to a likely spot on disk and run the following at a shell prompt (after installing git):
git clone -b develop
then set pharoCoreRepoPath below to path to repository directory inside PharoCore git repository.
Finally run the expressions in this workspace to connect your image up to the correct repositories.
| pharoCoreRepoPath metacelloRepository filetreeRepository
dalehenrich /
Created March 2, 2012 22:40
get rid of repositories that aren't in the given list of repostiroy descriptions.
"run this to remove cruft before saving image for download"
| standardRepos |
standardRepos := #('' ''
'' '' ).
MCRepositoryGroup default repositories do: [:repo |
(standardRepos includes: repo description)
ifFalse: [ MCRepositoryGroup default removeRepository: repo ]].