Skip to content

Commit 3cfd6af

Browse files
committed
git(docs[filter]): Document _filter on Git wrappers
why: Git.clone(), Git.fetch(), Git.pull(), and GitSubmoduleCmd.update() accepted _filter without describing their serialization, combine flattening, and rejection contracts in Parameters. what: - Add _filter parameter documentation across clone, fetch, pull, and submodule.update
1 parent cfcac8a commit 3cfd6af

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎src/libvcs/cmd/git.py‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,9 @@ def clone(
380380
Separate repository (.git/ ) from working tree
381381
force : bool, optional
382382
force operation to run
383+
_filter : GitFilterInput | None, optional
384+
Partial-clone object filter model, spec string, mapping, or
385+
sequence of filters; emits one ``--filter=<spec>`` per item.
383386
make_parents : bool, default: ``True``
384387
Creates checkout directory (`:attr:`self.path`) if it doesn't already exist.
385388
@@ -515,6 +518,12 @@ def fetch(
515518
) -> str:
516519
"""Download from repo. Wraps `git fetch <https://git-scm.com/docs/git-fetch>`_.
517520
521+
Parameters
522+
----------
523+
_filter : GitFilterInput | None, optional
524+
Partial-clone object filter model, spec string, mapping, or
525+
sequence of filters; emits one ``--filter=<spec>`` per item.
526+
518527
Examples
519528
--------
520529
>>> git = Git(path=example_git_repo.path)
@@ -931,6 +940,12 @@ def pull(
931940
) -> str:
932941
"""Download from repo. Wraps `git pull <https://git-scm.com/docs/git-pull>`_.
933942
943+
Parameters
944+
----------
945+
_filter : GitFilterInput | None, optional
946+
Rejected with :exc:`ValueError` when nonempty because native
947+
``git pull`` omits ``--filter``; call :meth:`Git.fetch` first.
948+
934949
Examples
935950
--------
936951
>>> git = Git(path=example_git_repo.path)
@@ -2573,6 +2588,13 @@ def update(
25732588
) -> str:
25742589
"""Git submodule update.
25752590
2591+
Parameters
2592+
----------
2593+
_filter : GitFilterInput | None, optional
2594+
Partial-clone object filter applied to initialized submodules;
2595+
multiple items flatten into one ``combine:`` flag, and ``auto`` is
2596+
rejected with :exc:`ValueError`.
2597+
25762598
Examples
25772599
--------
25782600
>>> GitSubmoduleCmd(path=example_git_repo.path).update()

0 commit comments

Comments
 (0)