ninjecto.plugins.namespaces.git

Namespace plugin to access git context.

Functions

ninjecto.plugins.namespaces.git.namespace_git(config)

Fetch information relative to the git context.

This function will fetch the git information only once per root directory unless the config function ninjecto.namespace.git.submodules is set to True, in which case the information will be called for every directory.

Parameters
config (dict) – Plugin configuration, if any.
Returns
A dynamic namespace function that returns an object with information from the git context of the file input it is called with.

Values available:

  • tag: tag for the current revision.
  • root: root of the git repository.
  • branch: current branch of the git repository.
  • revision: current revision of the git repository.
  • name: name of the author of the current revision.
  • email: email of the author of the current revision.
  • subject: commit message subject of current revision.
  • body: commit message body of current revision.
  • date: commit date in strict ISO 8601 format.
Return type
function