pkgcheck.addons.git module

Git specific support and addon.

class pkgcheck.addons.git.GitAddedRepo(*args, **kwargs)[source]

Bases: GitChangedRepo

Historical git repo consisting of added packages.

class pkgcheck.addons.git.GitAddon(*args)[source]

Bases: CachedAddon

Git repo support for various checks.

Pkgcheck can create virtual package repos from a given git repo’s history in order to provide more info for checks relating to stable requests, outdated blockers, or local commits. These virtual repos are cached and updated every run if new commits are detected.

Git repos must have a supported config in order to work properly. Specifically, pkgcheck assumes that the origin branch exists and tracks upstream.

Additionally, the origin/HEAD ref must exist. If it doesn’t, running git remote set-head origin master or similar for other branches will create it.

You can override the default git remote used for all git comparison using --git-remote.

cache = CacheData(type='git', file='git.pickle', version=5)
cached_repo(repo_cls)[source]
commits()[source]
commits_repo(repo_cls)[source]
gitignored(path)[source]

Determine if a given path in a repository is matched by .gitignore settings.

classmethod mangle_argparser(parser)[source]

Add extra options and/or groups to the argparser.

This hook is always triggered, even if the checker is not activated (because it runs before the commandline is parsed).

Parameters:

parser – an C{argparse.ArgumentParser} instance.

static pkg_history(repo, commit_range, data=None, local=False, verbosity=-1)[source]

Create or update historical package data for a given commit range.

update_cache(force=False)[source]

Update related cache and push updates to disk.

class pkgcheck.addons.git.GitCache(*args, commit)[source]

Bases: DictCache

Dictionary-based cache that encapsulates git commit data.

class pkgcheck.addons.git.GitChangedRepo(*args, **kwargs)[source]

Bases: SimpleTree

Historical git repo consisting of the latest changed packages.

class pkgcheck.addons.git.GitCommit(hash: str, commit_time: int, author: str, committer: str, message: tuple, pkgs: ImmutableDict = {})[source]

Bases: object

Git commit objects.

author: str
commit_time: int
committer: str
hash: str
message: tuple
pkgs: ImmutableDict = {}
class pkgcheck.addons.git.GitConfig[source]

Bases: object

Manages temporary file which holds git config for disabling safe directory feature of git.

close()[source]
property config_env
exception pkgcheck.addons.git.GitError[source]

Bases: Exception

Generic git-related error.

class pkgcheck.addons.git.GitLog(cmd, path)[source]

Bases: object

Iterator for decoded git log line output.

class pkgcheck.addons.git.GitModifiedRepo(*args, **kwargs)[source]

Bases: GitChangedRepo

Historical git repo consisting of the latest modified packages.

class pkgcheck.addons.git.GitPkgChange(atom: atom, status: str, commit: str, commit_time: int, old: atom = None)[source]

Bases: object

Git package change objects.

atom: atom
commit: str
commit_time: int
old: atom = None
status: str
class pkgcheck.addons.git.GitRemovedRepo(*args, **kwargs)[source]

Bases: GitChangedRepo

Historical git repo consisting of removed packages.

class pkgcheck.addons.git.GitRepoCommits(path, commit_range)[source]

Bases: _ParseGitRepo

Parse git log output into an iterator of commit objects.

class pkgcheck.addons.git.GitRepoPkgs(*args, local=False)[source]

Bases: _ParseGitRepo

Parse git log output into an iterator of package change objects.