kraken.std.git
kraken.std.git
Tools for Git versioned projects.
GitVersion
dataclass
Represents a "git version" that has a major, minor and patch version and optionally a commit distance.
Source code in kraken/std/git/version.py
dump_gitconfig
Formats a Git configuration file.
Source code in kraken/std/git/config.py
git_describe
Describe a repository with tags.
:param path: The directory in which to describe.
:param tags: Whether to include tags (adds the --tags
flag).
:param dirty: Whether to include if the directory tree is dirty (adds the --dirty
flag).
:raise ValueError: If git describe
failed.
:return: The Git head description.
Source code in kraken/std/git/version.py
gitignore_extend
gitignore_extend(
*,
project: Project | None = None,
patterns: Sequence[str],
dedup: bool = True
) -> None
Extend the Gitignore task's generated content section by the given patterns.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project |
Project | None
|
The project to look for the Gitignore task configuraton in. If it is not specified, it will be searched in the currently active project and any of its parents (often the Gitignore tasks only exist on the root project). |
None
|
patterns |
Sequence[str]
|
The patterns to add to the config. |
required |
dedup |
bool
|
If enabled, do not add any patterns that are already present. |
True
|
Source code in kraken/std/git/__init__.py
load_gitconfig
Parses a Git configuration file.