:py:mod:`gmuse.git` =================== .. py:module:: gmuse.git .. autodoc2-docstring:: gmuse.git :allowtitles: Module Contents --------------- Classes ~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`StagedDiff ` - .. autodoc2-docstring:: gmuse.git.StagedDiff :summary: * - :py:obj:`CommitRecord ` - .. autodoc2-docstring:: gmuse.git.CommitRecord :summary: * - :py:obj:`CommitHistory ` - .. autodoc2-docstring:: gmuse.git.CommitHistory :summary: * - :py:obj:`RepositoryInstructions ` - .. autodoc2-docstring:: gmuse.git.RepositoryInstructions :summary: * - :py:obj:`BranchInfo ` - .. autodoc2-docstring:: gmuse.git.BranchInfo :summary: Functions ~~~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`_run_git ` - .. autodoc2-docstring:: gmuse.git._run_git :summary: * - :py:obj:`_count_diff_lines ` - .. autodoc2-docstring:: gmuse.git._count_diff_lines :summary: * - :py:obj:`_parse_commit_line ` - .. autodoc2-docstring:: gmuse.git._parse_commit_line :summary: * - :py:obj:`_sanitize_branch_name ` - .. autodoc2-docstring:: gmuse.git._sanitize_branch_name :summary: * - :py:obj:`_parse_branch_info ` - .. autodoc2-docstring:: gmuse.git._parse_branch_info :summary: * - :py:obj:`is_git_repository ` - .. autodoc2-docstring:: gmuse.git.is_git_repository :summary: * - :py:obj:`get_repo_root ` - .. autodoc2-docstring:: gmuse.git.get_repo_root :summary: * - :py:obj:`get_staged_diff ` - .. autodoc2-docstring:: gmuse.git.get_staged_diff :summary: * - :py:obj:`get_commit_history ` - .. autodoc2-docstring:: gmuse.git.get_commit_history :summary: * - :py:obj:`truncate_diff ` - .. autodoc2-docstring:: gmuse.git.truncate_diff :summary: * - :py:obj:`load_repository_instructions ` - .. autodoc2-docstring:: gmuse.git.load_repository_instructions :summary: * - :py:obj:`get_current_branch ` - .. autodoc2-docstring:: gmuse.git.get_current_branch :summary: Data ~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`logger ` - .. autodoc2-docstring:: gmuse.git.logger :summary: * - :py:obj:`_GIT_TIMEOUT_SHORT ` - .. autodoc2-docstring:: gmuse.git._GIT_TIMEOUT_SHORT :summary: * - :py:obj:`_GIT_TIMEOUT_LONG ` - .. autodoc2-docstring:: gmuse.git._GIT_TIMEOUT_LONG :summary: API ~~~ .. py:data:: logger :canonical: gmuse.git.logger :value: 'get_logger(...)' .. autodoc2-docstring:: gmuse.git.logger .. py:data:: _GIT_TIMEOUT_SHORT :canonical: gmuse.git._GIT_TIMEOUT_SHORT :type: typing.Final[int] :value: 5 .. autodoc2-docstring:: gmuse.git._GIT_TIMEOUT_SHORT .. py:data:: _GIT_TIMEOUT_LONG :canonical: gmuse.git._GIT_TIMEOUT_LONG :type: typing.Final[int] :value: 30 .. autodoc2-docstring:: gmuse.git._GIT_TIMEOUT_LONG .. py:class:: StagedDiff :canonical: gmuse.git.StagedDiff .. autodoc2-docstring:: gmuse.git.StagedDiff .. py:attribute:: raw_diff :canonical: gmuse.git.StagedDiff.raw_diff :type: str :value: None .. autodoc2-docstring:: gmuse.git.StagedDiff.raw_diff .. py:attribute:: files_changed :canonical: gmuse.git.StagedDiff.files_changed :type: list[str] :value: None .. autodoc2-docstring:: gmuse.git.StagedDiff.files_changed .. py:attribute:: lines_added :canonical: gmuse.git.StagedDiff.lines_added :type: int :value: None .. autodoc2-docstring:: gmuse.git.StagedDiff.lines_added .. py:attribute:: lines_removed :canonical: gmuse.git.StagedDiff.lines_removed :type: int :value: None .. autodoc2-docstring:: gmuse.git.StagedDiff.lines_removed .. py:attribute:: hash :canonical: gmuse.git.StagedDiff.hash :type: str :value: None .. autodoc2-docstring:: gmuse.git.StagedDiff.hash .. py:attribute:: size_bytes :canonical: gmuse.git.StagedDiff.size_bytes :type: int :value: None .. autodoc2-docstring:: gmuse.git.StagedDiff.size_bytes .. py:attribute:: truncated :canonical: gmuse.git.StagedDiff.truncated :type: bool :value: False .. autodoc2-docstring:: gmuse.git.StagedDiff.truncated .. py:class:: CommitRecord :canonical: gmuse.git.CommitRecord .. autodoc2-docstring:: gmuse.git.CommitRecord .. py:attribute:: hash :canonical: gmuse.git.CommitRecord.hash :type: str :value: None .. autodoc2-docstring:: gmuse.git.CommitRecord.hash .. py:attribute:: message :canonical: gmuse.git.CommitRecord.message :type: str :value: None .. autodoc2-docstring:: gmuse.git.CommitRecord.message .. py:attribute:: author :canonical: gmuse.git.CommitRecord.author :type: str :value: None .. autodoc2-docstring:: gmuse.git.CommitRecord.author .. py:attribute:: timestamp :canonical: gmuse.git.CommitRecord.timestamp :type: datetime.datetime :value: None .. autodoc2-docstring:: gmuse.git.CommitRecord.timestamp .. py:class:: CommitHistory :canonical: gmuse.git.CommitHistory .. autodoc2-docstring:: gmuse.git.CommitHistory .. py:attribute:: commits :canonical: gmuse.git.CommitHistory.commits :type: list[gmuse.git.CommitRecord] :value: None .. autodoc2-docstring:: gmuse.git.CommitHistory.commits .. py:attribute:: depth :canonical: gmuse.git.CommitHistory.depth :type: int :value: None .. autodoc2-docstring:: gmuse.git.CommitHistory.depth .. py:attribute:: repository_path :canonical: gmuse.git.CommitHistory.repository_path :type: str :value: None .. autodoc2-docstring:: gmuse.git.CommitHistory.repository_path .. py:class:: RepositoryInstructions :canonical: gmuse.git.RepositoryInstructions .. autodoc2-docstring:: gmuse.git.RepositoryInstructions .. py:attribute:: content :canonical: gmuse.git.RepositoryInstructions.content :type: str :value: None .. autodoc2-docstring:: gmuse.git.RepositoryInstructions.content .. py:attribute:: file_path :canonical: gmuse.git.RepositoryInstructions.file_path :type: str :value: None .. autodoc2-docstring:: gmuse.git.RepositoryInstructions.file_path .. py:attribute:: exists :canonical: gmuse.git.RepositoryInstructions.exists :type: bool :value: None .. autodoc2-docstring:: gmuse.git.RepositoryInstructions.exists .. py:class:: BranchInfo :canonical: gmuse.git.BranchInfo .. autodoc2-docstring:: gmuse.git.BranchInfo .. py:attribute:: raw_name :canonical: gmuse.git.BranchInfo.raw_name :type: str :value: None .. autodoc2-docstring:: gmuse.git.BranchInfo.raw_name .. py:attribute:: branch_type :canonical: gmuse.git.BranchInfo.branch_type :type: typing.Optional[str] :value: None .. autodoc2-docstring:: gmuse.git.BranchInfo.branch_type .. py:attribute:: branch_summary :canonical: gmuse.git.BranchInfo.branch_summary :type: typing.Optional[str] :value: None .. autodoc2-docstring:: gmuse.git.BranchInfo.branch_summary .. py:attribute:: is_default :canonical: gmuse.git.BranchInfo.is_default :type: bool :value: False .. autodoc2-docstring:: gmuse.git.BranchInfo.is_default .. py:function:: _run_git(*args: str, cwd: typing.Optional[str] = None, timeout: int = _GIT_TIMEOUT_SHORT, check: bool = True) -> subprocess.CompletedProcess[str] :canonical: gmuse.git._run_git .. autodoc2-docstring:: gmuse.git._run_git .. py:function:: _count_diff_lines(raw_diff: str) -> tuple[int, int] :canonical: gmuse.git._count_diff_lines .. autodoc2-docstring:: gmuse.git._count_diff_lines .. py:function:: _parse_commit_line(line: str) -> typing.Optional[gmuse.git.CommitRecord] :canonical: gmuse.git._parse_commit_line .. autodoc2-docstring:: gmuse.git._parse_commit_line .. py:function:: _sanitize_branch_name(branch_name: str, max_length: int = 60) -> str :canonical: gmuse.git._sanitize_branch_name .. autodoc2-docstring:: gmuse.git._sanitize_branch_name .. py:function:: _parse_branch_info(branch_name: str, max_length: int = 60) -> tuple[typing.Optional[str], typing.Optional[str]] :canonical: gmuse.git._parse_branch_info .. autodoc2-docstring:: gmuse.git._parse_branch_info .. py:function:: is_git_repository(path: typing.Optional[pathlib.Path] = None) -> bool :canonical: gmuse.git.is_git_repository .. autodoc2-docstring:: gmuse.git.is_git_repository .. py:function:: get_repo_root(path: typing.Optional[pathlib.Path] = None) -> pathlib.Path :canonical: gmuse.git.get_repo_root .. autodoc2-docstring:: gmuse.git.get_repo_root .. py:function:: get_staged_diff() -> gmuse.git.StagedDiff :canonical: gmuse.git.get_staged_diff .. autodoc2-docstring:: gmuse.git.get_staged_diff .. py:function:: get_commit_history(depth: int = 5) -> gmuse.git.CommitHistory :canonical: gmuse.git.get_commit_history .. autodoc2-docstring:: gmuse.git.get_commit_history .. py:function:: truncate_diff(diff: gmuse.git.StagedDiff, max_bytes: int = 20000) -> gmuse.git.StagedDiff :canonical: gmuse.git.truncate_diff .. autodoc2-docstring:: gmuse.git.truncate_diff .. py:function:: load_repository_instructions() -> gmuse.git.RepositoryInstructions :canonical: gmuse.git.load_repository_instructions .. autodoc2-docstring:: gmuse.git.load_repository_instructions .. py:function:: get_current_branch(max_length: int = 60) -> typing.Optional[gmuse.git.BranchInfo] :canonical: gmuse.git.get_current_branch .. autodoc2-docstring:: gmuse.git.get_current_branch