GitPython icon indicating copy to clipboard operation
GitPython copied to clipboard

Missing definition in API documentation: `repo.git`

Open cowlinator opened this issue 3 years ago • 2 comments

API documentation at https://gitpython.readthedocs.io/en/stable/reference.html#git.repo.base.Repo.git does not describe repo.git. What type of object is it? What are its function definitions?

I'm looking at modifying code that uses repo.git.describe() (which I would think would be a popular function and thus definitely documented), but I can find no function definition in the api, and I dont' know what arguments it accepts.

cowlinator avatar Jan 29 '22 01:01 cowlinator

Indeed, the field itself could use some documentation maybe along with some docs on how to use it.

It can't be documented as its functions are all 'virtual', they act as away to build a git command-line invocation, so repo.git.foo() is valid and causes git foo to be called.

Byron avatar Jan 30 '22 00:01 Byron

@Byron , great.

What you wrote here is exactly the information that needs to be in the document at https://gitpython.readthedocs.io/en/stable/reference.html

git= None

repo.git is a virtual object which represents a git command-line invocation.  See [documentation on how to use it](https://gitpython.readthedocs.io/en/stable/tutorial.html#using-git-directly).

cowlinator avatar Jan 31 '22 23:01 cowlinator