sdkagent

GitPython API reference

127 public APIs from GitPython (gitpython-developers/GitPython) — 36 classes, 27 functions, 64 methods. Signatures extracted by static analysis of the actual source.

Repository: gitpython-developers/GitPython

KindCount
Classes36
Functions27
Methods64

API list

funcfuzzing.fuzz-targets.utils.handle_exception(e:Exception) -> int
Encapsulate exception handling logic for reusability.
funcfuzzing.fuzz-targets.utils.read_lines_from_file(file_path:str) -> list
Read lines from a file and return them as a list.
funcfuzzing.fuzz-targets.utils.setup_git_environment() -> None
Set up the environment variables for Git.
classgit.cmd.Git
The Git class manages communication with the Git binary.
methodgit.cmd.Git.check_unsafe_protocols(url:str) -> None
Check for unsafe protocols.
methodgit.cmd.Git.clear_cache() -> 'Git'
Clear all kinds of internal caches to release resources.
funcgit.cmd.Git.kill_process(pid:int) -> None
Callback to kill a process.
methodgit.cmd.Git.update_environment(**kwargs:Any) -> Dict[str, Union[str, None]]
Set environment variables for future git invocations.
methodgit.cmd.Git.working_dir() -> Union[None, PathLike]
:return: Git directory we are working on
classgit.diff.Diff
A Diff contains diff information between two Trees.
methodgit.diff.Diff.renamed() -> bool
Deprecated, use :attr:`renamed_file` instead.
classgit.diff.DiffConstants
Special objects for :meth:`Diffable.diff`.
classgit.exc.GitError
Base class for all package exceptions.
classgit.exc.HookExecutionError
Thrown if a hook exits with a non-zero exit code.
classgit.exc.NoSuchPathError
Thrown if a path could not be access by the system.
classgit.exc.WorkTreeRepositoryUnsupported
Thrown to indicate we can't handle work tree repositories.
funcgit.index.fun.read_cache(stream:IO[bytes]) -> Tuple[int, Dict[Tuple[PathLike, int], 'IndexEntry'], bytes, bytes]
Read a cache file from the given stream.
funcgit.index.fun.read_header(stream:IO[bytes]) -> Tuple[int, int]
Return tuple(version_long, num_entries) from the given stream.
funcgit.index.fun.run_commit_hook(name:str, index:'IndexFile', *args:str) -> None
Run the commit hook of the given name.
methodgit.index.typ.IndexEntry.from_blob(blob:Blob, stage:int=0) -> 'IndexEntry'
:return: Minimal entry resembling the given blob object
classgit.objects.base.IndexObject
Base for all objects that can be part of the index file.
classgit.objects.base.Object
Base class for classes representing git object types.
methodgit.objects.base.Object.hexsha() -> str
:return: 40 byte hex version of our 20 byte binary sha
methodgit.objects.base.Object.stream_data(ostream:'OStream') -> 'Object'
Write our data directly to the given output stream.
classgit.objects.blob.Blob
A Blob encapsulates a git blob object.
classgit.objects.commit.Commit
Wraps a git commit object.
methodgit.objects.commit.Commit.iter_parents(paths:Union[PathLike, Sequence[PathLike]]='', **kwargs:Any) -> Iterator['Commit']
Iterate *all* parents of this commit.
methodgit.objects.commit.Commit.replace(**kwargs:Any) -> 'Commit'
Create new commit object from an existing commit object.
methodgit.objects.commit.Commit.summary() -> Union[str, bytes]
:return: First line of the commit message
methodgit.objects.commit.Commit.trailers() -> Dict[str, str]
Deprecated.
methodgit.objects.commit.Commit.trailers_dict() -> Dict[str, List[str]]
Get the trailers of the message as a dictionary.
methodgit.objects.commit.Commit.trailers_list() -> List[Tuple[str, str]]
Get the trailers of the message as a list.
classgit.objects.submodule.base.Submodule
Implements access to a git submodule.
methodgit.objects.submodule.base.Submodule.deinit(force:bool=False) -> 'Submodule'
Run ``git submodule deinit`` on this submodule.
methodgit.objects.submodule.base.Submodule.move(module_path:PathLike, configuration:bool=True, module:bool=True) -> 'Submodule'
Move the submodule to a another module path.
methodgit.objects.submodule.base.Submodule.name() -> str
:return: The name of this submodule.
methodgit.objects.submodule.base.Submodule.remove(module:bool=True, force:bool=False, configuration:bool=True, dry_run:bool=False) -> 'Submodule'
Remove this submodule from the repository.
methodgit.objects.submodule.base.Submodule.rename(new_name:str) -> 'Submodule'
Rename this submodule.
funcgit.objects.submodule.util.mkhead(repo:'Repo', path:PathLike) -> 'Head'
:return: New branch/head instance
funcgit.objects.submodule.util.sm_name(section:str) -> str
:return: Name of the submodule as parsed from the section name
funcgit.objects.submodule.util.sm_section(name:str) -> str
:return: Section title used in ``.gitmodules`` configuration file
classgit.objects.tag.TagObject
Annotated (i.e.
methodgit.objects.tree.Tree.join(file:PathLike) -> IndexObjUnion
Find the named object in this tree's contents.
funcgit.objects.util.altz_to_utctz_str(altz:float) -> str
Convert a timezone offset west of UTC in seconds into a Git timezone offset string.
funcgit.objects.util.verify_utctz(offset:str) -> str
:raise ValueError: If `offset` is incorrect.
funcgit.refresh(path:Optional[PathLike]=None) -> None
Convenience method for setting the git executable path.
classgit.refs.head.Head
A Head is a named reference to a :class:`~git.objects.commit.Commit`.
methodgit.refs.head.Head.delete(repo:'Repo', *force:bool=False, *heads:'Union[Head, str]', **kwargs:Any) -> None
Delete the given heads.
methodgit.refs.head.Head.rename(new_path:PathLike, force:bool=False) -> 'Head'
Rename self to a new path.
classgit.refs.log.RefLogEntry
Named tuple allowing easy access to the revlog data fields.
methodgit.refs.log.RefLogEntry.actor() -> Actor
Actor instance, providing access.
methodgit.refs.log.RefLogEntry.format() -> str
:return: A string suitable to be placed in a reflog file.
methodgit.refs.log.RefLogEntry.new(oldhexsha:str, newhexsha:str, actor:Actor, time:int, tz_offset:int, message:str) -> 'RefLogEntry'
:return: New instance of a :class:`RefLogEntry`
classgit.refs.reference.Reference
A named reference to any object.
methodgit.refs.reference.Reference.remote_head() -> str
:return: Name of the remote head itself, e.g.
classgit.refs.remote.RemoteReference
A reference pointing to a remote head.
methodgit.refs.remote.RemoteReference.create(*args:Any, **kwargs:Any) -> NoReturn
Raise :exc:`TypeError`.
methodgit.refs.remote.RemoteReference.delete(repo:'Repo', *refs:'RemoteReference', **kwargs:Any) -> None
Delete the given remote references.
classgit.refs.symbolic.SymbolicReference
Special case of a reference that is symbolic.
methodgit.refs.symbolic.SymbolicReference.commit() -> 'Commit'
Query or set commits directly
methodgit.refs.symbolic.SymbolicReference.delete(repo:'Repo', path:PathLike) -> None
Delete the reference at the given path.
methodgit.refs.symbolic.SymbolicReference.from_path(repo:'Repo', path:PathLike) -> T_References
Make a symbolic reference from a path.
methodgit.refs.symbolic.SymbolicReference.iter_items(repo:'Repo', common_path:Union[PathLike, None]=None, *args:Any, **kwargs:Any) -> Iterator[T_References]
Find all refs in the repository.
methodgit.refs.symbolic.SymbolicReference.log_append(oldbinsha:bytes, message:Union[str, None], newbinsha:Union[bytes, None]=None) -> 'RefLogEntry'
Append a logentry to the logfile of this ref.
methodgit.refs.symbolic.SymbolicReference.object() -> AnyGitObject
Return the object our ref currently refers to
methodgit.refs.symbolic.SymbolicReference.rename(new_path:PathLike, force:bool=False) -> 'SymbolicReference'
Rename self to a new path.
methodgit.refs.symbolic.SymbolicReference.set_reference(ref:Union[AnyGitObject, 'SymbolicReference', str], logmsg:Union[str, None]=None) -> 'SymbolicReference'
Set ourselves to the given `ref`.
methodgit.refs.tag.TagReference.delete(repo:'Repo', *tags:'TagReference') -> None
Delete the given existing tag or tags.
methodgit.remote.FetchInfo.commit() -> 'Commit'
:return: Commit of our remote ref
methodgit.remote.FetchInfo.name() -> str
:return: Name of our remote ref
methodgit.remote.PushInfoList.raise_if_error() -> None
Raise an exception if any ref failed to push.
classgit.remote.Remote
Provides easy read and write access to a git remote.
methodgit.remote.Remote.create(repo:'Repo', name:str, url:str, allow_unsafe_protocols:bool=False, **kwargs:Any) -> 'Remote'
Create a new remote to the given repository.
methodgit.remote.Remote.exists() -> bool
:return: ``True`` if this is a valid, existing remote.
methodgit.remote.Remote.remove(repo:'Repo', name:str) -> str
Remove the remote with the given name.
methodgit.remote.Remote.rename(new_name:str) -> 'Remote'
Rename self to the given `new_name`.
methodgit.remote.Remote.rm(repo:'Repo', name:str) -> str
Alias of remove.
methodgit.remote.Remote.set_url(new_url:str, old_url:Optional[str]=None, allow_unsafe_protocols:bool=False, **kwargs:Any) -> 'Remote'
Configure URLs on current remote (cf.
methodgit.repo.base.Repo.active_branch() -> Head
The name of the currently active branch.
methodgit.repo.base.Repo.bare() -> bool
:return: ``True`` if the repository is bare
methodgit.repo.base.Repo.branches() -> 'IterableList[Head]'
Alias for heads.
methodgit.repo.base.Repo.create_head(path:PathLike, commit:Union['SymbolicReference', 'str']='HEAD', force:bool=False, logmsg:Optional[str]=None) -> 'Head'
Create a new head within the repository.
methodgit.repo.base.Repo.create_remote(name:str, url:str, **kwargs:Any) -> Remote
Create a new remote.
methodgit.repo.base.Repo.create_submodule(*args:Any, **kwargs:Any) -> Submodule
Create a new submodule.
methodgit.repo.base.Repo.create_tag(path:PathLike, ref:Union[str, 'SymbolicReference']='HEAD', message:Optional[str]=None, force:bool=False, **kwargs:Any) -> TagReference
Create a new tag reference.
methodgit.repo.base.Repo.daemon_export() -> bool
If True, git-daemon may export this repository
methodgit.repo.base.Repo.delete_head(*heads:'Union[str, Head]', **kwargs:Any) -> None
Delete the given heads.
methodgit.repo.base.Repo.delete_remote(remote:'Remote') -> str
Delete the given remote.
methodgit.repo.base.Repo.delete_tag(*tags:TagReference) -> None
Delete the given tag references.
methodgit.repo.base.Repo.description() -> str
The project's description
methodgit.repo.base.Repo.ignored(*paths:PathLike) -> List[str]
Checks if paths are ignored via ``.gitignore``.
methodgit.repo.base.Repo.is_ancestor(ancestor_rev:Commit, rev:Commit) -> bool
Check if a commit is an ancestor of another.
methodgit.repo.base.Repo.iter_submodules(*args:Any, **kwargs:Any) -> Iterator[Submodule]
An iterator yielding Submodule instances.
methodgit.repo.base.Repo.refs() -> 'IterableList[Reference]'
Alias for references.
funcgit.repo.fun.deref_tag(tag:'Tag') -> AnyGitObject
Recursively dereference a tag and return the resulting object.
funcgit.repo.fun.find_submodule_git_dir(d:PathLike) -> Optional[PathLike]
Search for a submodule repo.
funcgit.repo.fun.find_worktree_git_dir(dotgit:PathLike) -> Optional[str]
Search for a gitdir for this worktree.
funcgit.repo.fun.is_git_dir(d:PathLike) -> bool
This is taken from the git setup.c:is_git_directory function.
funcgit.repo.fun.rev_parse(repo:'Repo', rev:str) -> AnyGitObject
Parse a revision string.
funcgit.repo.fun.to_commit(obj:Object) -> 'Commit'
Convert the given object to a commit if possible and return it.
classgit.types.Total_TD
Dictionary with total stats from any number of files.
classgit.util.Iterable
Deprecated, use :class:`IterableObj` instead.
methodgit.util.Iterable.iter_items(repo:'Repo', *args:Any, **kwargs:Any) -> Any
Deprecated, use :class:`IterableObj` instead.
methodgit.util.Iterable.list_items(repo:'Repo', *args:Any, **kwargs:Any) -> Any
Deprecated, use :class:`IterableObj` instead.
funcgit.util.assure_directory_exists(path:PathLike, is_file:bool=False) -> bool
Make sure that the directory pointed to by path exists.
funcgit.util.cwd(new_dir:PathLike) -> Generator[PathLike, None, None]
Context manager to temporarily change directory.
funcgit.util.handler(function:Callable[[str], Any], path:str, _excinfo:Any) -> None
Callback for :func:`shutil.rmtree`.
funcgit.util.patch_env(name:str, value:str) -> Generator[None, None, None]
Context manager to temporarily patch an environment variable.
funcgit.util.py_where(program:str, path:Optional[PathLike]=None) -> List[str]
Perform a path search to assist :func:`is_cygwin_git`.
funcgit.util.rmtree(path:PathLike) -> None
Remove the given directory tree recursively.
classgitdb.gitdb.base.IStream
Represents an input content stream to be fed into the ODB.
classgitdb.gitdb.base.InvalidOStream
Carries information about an invalid ODB stream
classgitdb.gitdb.base.ODeltaStream
Uses size info of its stream, delaying reads
classgitdb.gitdb.db.base.CachingDB
A database which uses caches to speed-up access
classgitdb.gitdb.db.base.CompoundDB
A database which delegates calls to sub-databases.
classgitdb.gitdb.db.base.ObjectDBR
Defines an interface for object database lookup.
classgitdb.gitdb.db.base.ObjectDBW
Defines an interface to create objects in the database
classgitdb.gitdb.db.loose.LooseObjectDB
A database which operates on loose object files
classgitdb.gitdb.db.pack.PackedDB
A database operating on a set of object packs
classgitdb.gitdb.db.ref.ReferenceDB
A database consisting of database referred to in a file
classgitdb.gitdb.exc.BadName
A name provided to rev_parse wasn't understood
classgitdb.gitdb.exc.BadObject
The object with the given SHA does not exist.
classgitdb.gitdb.exc.BadObjectType
The object had an unsupported type
classgitdb.gitdb.exc.ODBError
All errors thrown by the object database
classgitdb.gitdb.fun.DeltaChunkList
List with special functionality to deal with DeltaChunks.
funcgitdb.gitdb.util.to_hex_sha(sha)
:return: hexified version of sha
funcsmmap.smmap.util.is_64_bit()
:return: True if the system is 64 bit.

About this data

These signatures were extracted from the public source of gitpython-developers/GitPython using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries