Skip to content

GitContext

Local repository information.

commits class-attribute instance-attribute

commits: list[Any] = field(default_factory=list)

List of last commits (Commit objects from GitPython).

current_author class-attribute instance-attribute

current_author: str = ''

Author email for last commit.

current_committer class-attribute instance-attribute

current_committer: str = ''

Committer name for last commit.

current_date_authored class-attribute instance-attribute

current_date_authored: datetime | None = None

Date authored for last commit.

current_date_committed class-attribute instance-attribute

current_date_committed: datetime | None = None

Date committed for last commit.

current_sha class-attribute instance-attribute

current_sha: str = ''

SHA of last commit.

edit_uri class-attribute instance-attribute

edit_uri: str | None = None

Edit uri (depends on code hoster).

last_version class-attribute instance-attribute

last_version: str | None = None

Name of last commit tag.

main_branch class-attribute instance-attribute

main_branch: str = ''

Name of the main branch of the repo (master / main).

repo_hoster class-attribute instance-attribute

repo_hoster: str = ''

Name of the code hoster (for example GitHub)

repo_name class-attribute instance-attribute

repo_name: str = ''

Name of the git folder.

__init__

__init__(
    main_branch: str = "",
    repo_name: str = "",
    commits: list[Any] = list(),
    repo_hoster: str = "",
    edit_uri: str | None = None,
    current_sha: str = "",
    current_committer: str = "",
    current_date_committed: datetime | None = None,
    current_author: str = "",
    current_date_authored: datetime | None = None,
    last_version: str | None = None,
) -> None

__repr__

__repr__() -> str