This spec describes a plugin for Gedit that will implement a generic source control management interface to specific SCM tools.


Gedit's new plugin framework has opened up a world of possibilities for programmers interested in leveraging the popular editor's simplicity, power and ubiquity. Many developers, myself included, would prefer to program primarily in Gedit when working in a graphical environment, but are often forced to drop to the command line when managing source code. It is for this reason that I propose to implement a plugin for Gedit that makes source control simple and painless.

Use cases

Juliet is working on a versioned file and saves her work. She plans on committing her changes, as she's just completed a substantive feature. Instead of dropping to the command line and committing her specific file, she merely presses the 'Commit' button on the toolbar, summarizes her changes in the prompt presented to her and begins working on the next feature. The file she has saved is, meanwhile, committed to whatever repository it belongs to using the appropriate SCM utility (either her default or a separate tool).


This plugin will include the following functionality:

  • Abstraction of a generic SCM interface for common actions (commit, update, diff, etc.)
  • An interface for more specific plugins to act as backends for the actions delineated above
  • At least one example of such a backend plugin (initially a Bazaar client, with other common SCMs to follow as time permits)


The plugin will provide a generic framework which encompasses the basic, common functionality of most SCMs (with each backend capable of extending the general model). A configuration dialog is provided per-document -- with sensible universal defaults, of course -- that will allow developers to choose which VCS they'd prefer to use on a per-document basis. The framework will be written in such a way that, should a user desire an interface to an SCM that is not currently implemented, they need merely provide a small script exposing said SCM's functionality to this generic interface. The initial backend will use the Bazaar SCM. Any operations requiring user interactions


The implemenation language will be Python, as this is Gedit's plugin framework's native language. Most SCMs also sport Python bindings or are written in Python (as Bazaar is). Even without bindings, Python allows for the execution of any SCM, if necessary. The plugin would scan the '~/.gnome2/gedit/plugins/scm/' directory and, for each SCM description it finds, add the backend described to its functional list. Users of this plugin would be able to select both a default SCM as well as make the decision on a per-document basis.

The file '~/.gnome2/gedit/plugins/' would implement the framework described above, in which common per-file SCM operations will be abstracted (commit, update, etc.). This file will also create toolbar buttons and action menu items corresponding to these operations. Individual SCM backend modules will inherit methods from a generic SCMPlugin object (i.e. the BZR_SCMPlugin object would inherit and override SCMPlugin.commit(), SCMPlugin.update(), etc. with bzr-specific commands).

Outstanding issues

BoF agenda and discussion


GeditSCMPlugin (last edited 2008-08-06 16:14:12 by localhost)