Last updated at 9:14 pm UTC on 3 June 2020
The Git Browser is a graphical user interface to operate on Smalltalk projects that are tracked in Git repositories. It allows you to manage working copies, track packages (multiple per working copy, which are all versioned together), browse branches, create new commits, search for commits, synchronize with remote repositories, and perform checkouts and merges. It can be used without a Git outside of Squeak (it does not call external processes or shared libraries).
The tool is primarily meant to maintain Squeak projects, which are published on GitHub or similar platforms, but can be used with any Git repository.
How to install the Git Browser
Install the Git Browser by choosing Tools > Git Browser in your Squeak image (since 5.2). This will also load several of dependencies via Metacello.
How to use the Git Browser
Once you have the Git Browser opened from the Tools menu for the first time, it will prompt you whether you want to create your first project now. If you would like to start a fresh and empty working copy on an empty Git repository, select “yes” and provide a path for the Git repository. If you would rather like to clone an existing Git repository, select “no.”
The Git browser itself has five panes:
- On the top left, there is a list of projects. These are your working copies. Each working copy links something in your Squeak image to a Git repository outside of that image. Via the context menu of this list, you can add, change, or delete working copies and repositories. If this list is empty, you will want to start with the context menu here.
- Below that, there is a list of branches in the currently selected project (if any). Via the context menu, you can add, rename, and remove branches, push to remote repositories, and switch branches. One branch is highlighted with a green dot; this is the branch that is currently checked-out. If you create new commits, they will go on this branch.
- On the top right, there is the list of commits on the current branch (if any). You can compare commits with each other or a commit with the working copy, search for commits using the search bar below the list (or via list filtering to only search the headlines), create a new branch at a commit, reset the current branch to an older commit, or check out or merge specific objects from a commit.
- In the bottom-left pane, the full log message of the selected commit will be displayed. In addition to that, it will also show the commit metadata, such as the author, committer, and the abbreviated SHA-1 hash of the commit and its parents.
- Finally on the bottom right, there is a list of objects in the selected commit. These are usually the packages known in a particular commit. Via the context menu you can checkout or merge an object with the working copy (read checkout like “Load” in Monticello and merge like “Merge”), browse either the object as it was at the time of the commit, or what is currently loaded. You can also access the current scripts (preamble, postscript etc.) of packages here.
Between the panes, there is a strip of buttons. They operate on the current branch or the selected commit. At the far right, you can configure how things go to Git: that is your name and e-mail address for the commit metadata, the Smalltalk file format you want to produce (FileTree/Cypress or Tonel), and whether Squot should suppress writing its own configuration files (if you want to submit a pull request to a repository that is not developed with Squot, for example). Via the Feedback button, you can create an issue for Squot on GitHub directly from the image. You can also file these here: https://github.com/hpi-swa/Squot/issues
To add another package to a project, or remove a package from the set of tracked packages, open the menu of a project and choose “Change tracked packages”. Below that menu item, you can also change between writing FileTree/Cypress or Tonel files (“Set package storage format…”).
When you switch branches via the context menu of the branch list, note that it will stow away all your unsaved changes and the other branch is checked out clean. Your unsaved changes will be restored when you switch back to the original branch. This behavior is different from the Git CLI, and was conceived in an alternative Git frontend called “Gitless” (which addresses some of Git’s awkwardness).
When you want to commit, you will find that there is no Git staging area as far as the Git Browser and accompanying tools are concerned. Instead, you can choose which packages, classes, and methods you want to include or exclude in the commit dialog, like in Monticello in recent years.
When you checkout or merge something, you always first get a list of changes, from which you can choose what to load and what to skip.
To update the Git Browser when a new version was published, open the window dropdown menu (third button from the right in the title bar) and choose “self-update…”. It pulls the latest version from the master branch on GitHub. Ongoing development happens on the “develop” branch, not on master. You can also pull that version by choosing “set self-update branch…” in the same menu, and then invoke the update.
Which version control packages lie beneath the Git Browser
The Git Browser uses Squot to realize version control, not Monticello (although Squot uses parts of Monticello under the hood).
The adapter between Squot and Git uses a package called FileSystem-Git, which contains a pure Smalltalk implementation of Git.
The Git Browser is hosted together with Squot and the used version of FileSystem-Git on https://github.com/hpi-swa/Squot/
Current open issues are tracked here: https://github.com/hpi-swa/Squot/issues