Git
feu.local_git ¶
Contain git utility functions.
feu.local_git.get_last_tag_name ¶
get_last_tag_name(raise_error: bool = True) -> str | None
Get the name of the most recent tag in the current repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raise_error
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
str | None
|
The tag name, or |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if no tag was found and |
Example
>>> from feu.local_git import get_last_tag_name
>>> tag = get_last_tag_name()
>>> tag
>>> tag = get_last_tag_name(raise_error=False)
>>> tag
feu.local_git.get_last_version_tag_name ¶
get_last_version_tag_name(
raise_error: bool = True,
) -> str | None
Get the name of the most recent version tag in the current repository.
A version tag is a tag starting with v{number}*.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raise_error
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
str | None
|
The tag name, or |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if no version tag was found and
|
Example
>>> from feu.local_git import get_last_version_tag_name
>>> tag = get_last_version_tag_name()
>>> tag
>>> tag = get_last_version_tag_name(raise_error=False)
>>> tag
feu.local_git.get_tags ¶
get_tags() -> list[TagReference]
Get the list of git tags sorted by date/time for the current repository.
Returns:
| Type | Description |
|---|---|
list[TagReference]
|
The list of git tags sorted by date/time. |
Example
>>> from feu.local_git import get_tags
>>> tags = get_tags()
>>> tags