git-meta’s documentation

Authors:Jules David <jules@onada.fr> Tristan Gregoire <tristan@onada.fr>
Source code:github.com project
Bug tracker:github.com issues
License:BSD
Generated:Oct 28, 2018
Version:0.1.7

git-meta allows you to get a clear picture of all your local repository states.

_images/terminal.png

It is based on the pygit2 library

API

class gitmeta.Meta[source]

Class handling the repositories database

discover()[source]

Scan the subfolders to discover repositories

read_list()[source]

Read the database file to extract the paths of previously scanned repositories

scan(clean=False, filter_status=None)[source]

Scan all the repositories in the database for their statuses

Parameters:
  • clean (bool) – If True, remove any unvalid repository from the watched list
  • filter_status (str) – Only return repositiries having the given status. Usable status are “OK”, “KO”, “remote”, “NOK” and “all”
class gitmeta.Repo(path, *args, **kwargs)[source]

Bases: pygit2.repository.Repository

Class representing a repository.

Allows to perform common git commands

remote_diff()[source]

For each branch with a remote counterpart, give the number of commit difference

Returns:
keys -> branch name
values -> number
Return type:dict
stashed()[source]

List stashes

Returns:True if there is stashed modifications
Return type:bool
status()[source]

Gives the status of the current branch.

Contrarily to pygit2.Repository, self.status() does not show the ignored files.

Returns:
Each key stand for a file with a non-clean status, and the
value is the code of this non-clean status. See pygit2.GIT_STATUS_* for details. If empty, all files are clean.
Return type:dict
statusline(line_width=80)[source]

Create the status line for the selected repository.

Returns:Status line as used by git-meta
Return type:string

Tests

git-meta tests are located in the test/ folder. They are powered by pytest.

In order to launch the test series, you only have to type the command :

$ py.test

in the base folder.

Indices and tables