git_ops
git information access.
| CLASS | DESCRIPTION |
|---|---|
GitTag |
Represents a Git tag and its associated data. |
TagInfo |
Simple storage of tag information. |
| FUNCTION | DESCRIPTION |
|---|---|
get_commits_by_tags |
Group commits by the tags they belong to. |
get_repo |
Get the git repo from a specific path or the current working directory. |
get_tags |
Get all the tags in a repository. |
parse_commits |
Parse the commits for later processing. |
Classes¶
GitTag
dataclass
¶
Represents a Git tag and its associated data.
This class is used to encapsulate details about a Git tag, including its name, additional information, and a list of related commits. It is immutable to ensure the integrity of the stored data, making it safe for concurrent and controlled usage.
| ATTRIBUTE | DESCRIPTION |
|---|---|
tag_name |
The name of the Git tag.
TYPE:
|
tag_info |
Metadata and additional details associated with the Git tag.
TYPE:
|
commits |
The list of commits that are associated with this Git tag.
TYPE:
|
TagInfo
dataclass
¶
Simple storage of tag information.
| ATTRIBUTE | DESCRIPTION |
|---|---|
date_string |
Convenience method to return an ISO8601 date string.
TYPE:
|
Functions¶
get_commits_by_tags
¶
get_commits_by_tags(
repository: Repo,
tag_filter_pattern: str,
starting_tag: Optional[str] = None,
) -> List[GitTag]
Group commits by the tags they belong to.
| PARAMETER | DESCRIPTION |
|---|---|
repository
|
The git repository object
TYPE:
|
tag_filter_pattern
|
A regular expression pattern that matches valid tags as versions
TYPE:
|
starting_tag
|
Only include tags after this one |
| RETURNS | DESCRIPTION |
|---|---|
List[GitTag]
|
A list of dictionaries with tag information with most recent first |
get_repo
¶
get_tags
¶
parse_commits
¶
parse_commits(
repository: Repo,
starting_rev: Optional[str] = None,
ending_rev: Optional[str] = None,
) -> list
Parse the commits for later processing.
| PARAMETER | DESCRIPTION |
|---|---|
repository
|
The repository object.
TYPE:
|
starting_rev
|
Include all commits after this revision. |
ending_rev
|
include all commmits before and including this revision. |
| RETURNS | DESCRIPTION |
|---|---|
list
|
A list of CommitInfo objects. |