Skip to content
Rowan James edited this page Jun 11, 2013 · 2 revisions

GitX is an NSDocument-based, application, each open document represents a repository; and multiple documents can be opened at the same time. Many behaviours (opening and restoring windows, etc.) are simple handling of default NSDocument events.

A repository window represents the information loaded from the repository during opening or refreshing, and stored/manipulated mostly in PB(Git)?* classes, for the most part; these can be thought of as the modellayer of GitX.

These classes get their information from the repository in one of two ways; parsing the output of the git command line utility (see: PBEasyPipe and issue #2), or directly from the repository on-disk using either libgit2 or Objective-Git.framework.

This intermediate structure of model objects allows us to alter the way data is loaded, cached, interpreted, or displayed without affecting other layers of functionality. These classes will tend to shrink to triviality as their functionality is replaced with that of Objective-Git, and that's a Good Thing.

Objective-Git is by far the preferred way to load information, pull requests introducing further dependency on command-line Git are unlikely to be accepted. Using libgit2 directly where it supports something that Objective-Git does not is fine (rare, now), but if you can, please try to add the functionality to Objective-Git or create an encapsulation class that does.

Clone this wiki locally