Skip to content

Fix some incorrect sphinx markups in the docstrings #2018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions git/index/base.py
Original file line number Diff line number Diff line change
@@ -508,7 +508,7 @@ def iter_blobs(

:param predicate:
Function(t) returning ``True`` if tuple(stage, Blob) should be yielded by
the iterator. A default filter, the `~git.index.typ.BlobFilter`, allows you
the iterator. A default filter, the :class:`~git.index.typ.BlobFilter`, allows you
to yield blobs only if they match a given list of paths.
"""
for entry in self.entries.values():
@@ -770,7 +770,7 @@ def add(
- path string

Strings denote a relative or absolute path into the repository pointing
to an existing file, e.g., ``CHANGES``, `lib/myfile.ext``,
to an existing file, e.g., ``CHANGES``, ``lib/myfile.ext``,
``/home/gitrepo/lib/myfile.ext``.

Absolute paths must start with working tree directory of this index's
@@ -789,7 +789,7 @@ def add(

They are added at stage 0.

- :class:~`git.objects.blob.Blob` or
- :class:`~git.objects.blob.Blob` or
:class:`~git.objects.submodule.base.Submodule` object

Blobs are added as they are assuming a valid mode is set.
@@ -815,7 +815,7 @@ def add(

- :class:`~git.index.typ.BaseIndexEntry` or type

Handling equals the one of :class:~`git.objects.blob.Blob` objects, but
Handling equals the one of :class:`~git.objects.blob.Blob` objects, but
the stage may be explicitly set. Please note that Index Entries require
binary sha's.

@@ -998,7 +998,7 @@ def remove(

The path string may include globs, such as ``*.c``.

- :class:~`git.objects.blob.Blob` object
- :class:`~git.objects.blob.Blob` object

Only the path portion is used in this case.

4 changes: 2 additions & 2 deletions git/objects/base.py
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ def new(cls, repo: "Repo", id: Union[str, "Reference"]) -> AnyGitObject:
:return:
New :class:`Object` instance of a type appropriate to the object type behind
`id`. The id of the newly created object will be a binsha even though the
input id may have been a `~git.refs.reference.Reference` or rev-spec.
input id may have been a :class:`~git.refs.reference.Reference` or rev-spec.

:param id:
:class:`~git.refs.reference.Reference`, rev-spec, or hexsha.
@@ -218,7 +218,7 @@ class IndexObject(Object):
"""Base for all objects that can be part of the index file.

The classes representing git object types that can be part of the index file are
:class:`~git.objects.tree.Tree and :class:`~git.objects.blob.Blob`. In addition,
:class:`~git.objects.tree.Tree` and :class:`~git.objects.blob.Blob`. In addition,
:class:`~git.objects.submodule.base.Submodule`, which is not really a git object
type but can be part of an index file, is also a subclass.
"""
4 changes: 2 additions & 2 deletions git/objects/commit.py
Original file line number Diff line number Diff line change
@@ -289,7 +289,7 @@ def name_rev(self) -> str:
"""
:return:
String describing the commits hex sha based on the closest
`~git.refs.reference.Reference`.
:class:`~git.refs.reference.Reference`.

:note:
Mostly useful for UI purposes.
@@ -349,7 +349,7 @@ def iter_items(
return cls._iter_from_process_or_stream(repo, proc)

def iter_parents(self, paths: Union[PathLike, Sequence[PathLike]] = "", **kwargs: Any) -> Iterator["Commit"]:
R"""Iterate _all_ parents of this commit.
R"""Iterate *all* parents of this commit.

:param paths:
Optional path or list of paths limiting the :class:`Commit`\s to those that
2 changes: 1 addition & 1 deletion git/repo/base.py
Original file line number Diff line number Diff line change
@@ -512,7 +512,7 @@ def create_submodule(self, *args: Any, **kwargs: Any) -> Submodule:
def iter_submodules(self, *args: Any, **kwargs: Any) -> Iterator[Submodule]:
"""An iterator yielding Submodule instances.

See the `~git.objects.util.Traversable` interface for a description of `args`
See the :class:`~git.objects.util.Traversable` interface for a description of `args`
and `kwargs`.

:return: