Git repositories and sources/changes files (was Re: [squeak-dev]
[Squeak 4.0] Anyone know much about the format of the sources/changes
tonyg at lshift.net
Thu Feb 25 10:08:39 UTC 2010
Bert Freudenberg wrote:
> Randal is right. You can not just add something at the beginning of
> the sources or changes file. These are *NOT* text files but
> databases, the offsets are held in the image (each method knows the
> file position of its source code).
So, just as an aside, over an idle couple of days this week I
implemented the Git repository format in Smalltalk. (This is why I was
asking about the SystemChangeNotifier earlier.)
So far, it can
- initialize repositories
- read and write loose objects (blobs, trees, commits, tags)
- read packed objects (but not write them, yet)
- resolve and update refs (tags and branch heads)
I remember hearing something about a bit of good refactoring recently
that permitted *switching out the sources implementation* for an image.
Perhaps it could be backed onto a Git repository using this code.
Methods would then know the sha1 of the blob that holds the source.
#condenseSources feels very much like "git pack-objects" or "git gc".
I haven't done the network protocol yet (in large part because I can't
yet build (good) packs) so shelling out to "git fetch" and "git push" is
still needed for that.
More information about the Squeak-dev