pygit2 1.19.3__tar.gz → 1.20.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pygit2-1.19.3 → pygit2-1.20.0}/AGENTS.md +38 -24
- {pygit2-1.19.3 → pygit2-1.20.0}/AUTHORS.md +4 -2
- {pygit2-1.19.3 → pygit2-1.20.0}/CHANGELOG.md +52 -0
- pygit2-1.20.0/Makefile +7 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/PKG-INFO +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/build.sh +4 -4
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/__init__.py +20 -79
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/_build.py +2 -2
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/_libgit2/ffi.pyi +65 -2
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/_pygit2.pyi +6 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/_run.py +2 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/blame.py +3 -3
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/branches.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/callbacks.py +99 -42
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/config.py +68 -24
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/credentials.py +1 -1
- pygit2-1.20.0/pygit2/decl/rebase.h +80 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/enums.py +31 -2
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/errors.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/ffi.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/filter.py +4 -4
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/index.py +14 -14
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/options.py +19 -24
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/packbuilder.py +3 -3
- pygit2-1.20.0/pygit2/rebase.py +249 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/references.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/refspec.py +5 -5
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/remotes.py +38 -55
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/repository.py +286 -59
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/settings.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/submodules.py +12 -15
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/transaction.py +9 -9
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/utils.py +45 -7
- {pygit2-1.19.3 → pygit2-1.20.0}/pyproject.toml +5 -5
- {pygit2-1.19.3 → pygit2-1.20.0}/setup.py +1 -2
- {pygit2-1.19.3 → pygit2-1.20.0}/src/blob.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/branch.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/branch.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/commit.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/diff.c +13 -2
- {pygit2-1.19.3 → pygit2-1.20.0}/src/diff.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/error.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/error.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/filter.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/filter.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/mailmap.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/mailmap.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/note.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/note.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/object.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/object.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/odb.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/odb.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/odb_backend.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/odb_backend.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/oid.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/oid.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/patch.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/patch.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/pygit2.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/refdb.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/refdb.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/refdb_backend.c +173 -60
- {pygit2-1.19.3 → pygit2-1.20.0}/src/refdb_backend.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/reference.c +3 -2
- {pygit2-1.19.3 → pygit2-1.20.0}/src/reference.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/repository.c +10 -3
- {pygit2-1.19.3 → pygit2-1.20.0}/src/repository.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/revspec.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/revspec.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/signature.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/signature.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/stash.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/tag.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/tree.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/tree.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/treebuilder.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/treebuilder.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/types.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/utils.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/utils.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/walker.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/walker.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/worktree.c +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/src/worktree.h +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/__init__.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_apply_diff.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_archive.py +16 -14
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_attributes.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_blame.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_blob.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_branch.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_branch_empty.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_cherrypick.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_commit.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_commit_gpg.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_commit_trailer.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_config.py +90 -33
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_credentials.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_describe.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_diff.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_diff_binary.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_index.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_mailmap.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_merge.py +3 -22
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_nonunicode.py +21 -5
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_note.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_object.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_odb.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_odb_backend.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_oid.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_options.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_packbuilder.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_patch.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_patch_encoding.py +1 -1
- pygit2-1.20.0/test/test_rebase.py +795 -0
- pygit2-1.20.0/test/test_refdb_backend.py +295 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_refs.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_remote.py +142 -31
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_remote_prune.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_remote_utf8.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_repository.py +57 -56
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_repository_bare.py +2 -2
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_repository_custom.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_repository_empty.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_revparse.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_revwalk.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_settings.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_signature.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_status.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_submodule.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_tag.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_transaction.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_tree.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_treebuilder.py +1 -1
- {pygit2-1.19.3 → pygit2-1.20.0}/test/utils.py +1 -1
- pygit2-1.19.3/Makefile +0 -7
- pygit2-1.19.3/pygit2/legacyenums.py +0 -113
- pygit2-1.19.3/test/test_refdb_backend.py +0 -137
- {pygit2-1.19.3 → pygit2-1.20.0}/CONTRIBUTING.md +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/COPYING +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/README.md +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/SPONSORS.md +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/build.ps1 +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/build_tag.py +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/mypy-stubtest.ini +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/mypy.ini +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/blob.py +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/attr.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/blame.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/buffer.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/callbacks.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/checkout.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/clone.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/commit.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/common.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/config.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/describe.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/diff.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/errors.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/filter.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/graph.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/index.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/indexer.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/merge.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/net.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/oid.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/options.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/pack.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/proxy.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/refspec.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/remote.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/repository.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/revert.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/stash.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/strarray.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/submodule.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/transaction.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/transport.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/decl/types.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pygit2/py.typed +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/pytest.ini +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/requirements-test.txt +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/requirements-typing.txt +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/requirements-wheel.txt +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/requirements.txt +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/setup.cfg +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/src/wildmatch.c +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/src/wildmatch.h +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/conftest.py +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/barerepo.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/binaryfilerepo.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/blameflagsrepo.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/dirtyrepo.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/emptyrepo.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/encoding.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/gpgsigned.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/submodulerepo.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/testrepo.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/testrepoformerging.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/testrepopacked.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/trailerrepo.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/data/utf8branchrepo.zip +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/keys/pygit2_empty +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/keys/pygit2_empty.pub +0 -0
- {pygit2-1.19.3 → pygit2-1.20.0}/test/test_filter.py +0 -0
|
@@ -11,7 +11,7 @@ and a high-level, Pythonic API for repository manipulation.
|
|
|
11
11
|
- **License**: GPLv2 with linking exception (see `COPYING`)
|
|
12
12
|
- **Maintainer**: J. David Ibáñez
|
|
13
13
|
- **Python Support**: 3.11 – 3.14 and PyPy3 7.3+
|
|
14
|
-
- **libgit2 Version**: 1.9.
|
|
14
|
+
- **libgit2 Version**: 1.9.6
|
|
15
15
|
- **Homepage**: <https://www.pygit2.org/>
|
|
16
16
|
- **Repository**: <https://github.com/libgit2/pygit2>
|
|
17
17
|
|
|
@@ -56,8 +56,8 @@ modules:
|
|
|
56
56
|
`repository.py`, `callbacks.py`, `config.py`, `index.py`, `remotes.py`,
|
|
57
57
|
`settings.py`, `submodules.py`, `transaction.py`, `filter.py`, `blob.py`,
|
|
58
58
|
`blame.py`, `branches.py`, `credentials.py`, `errors.py`, `options.py`,
|
|
59
|
-
`packbuilder.py`, `
|
|
60
|
-
`
|
|
59
|
+
`packbuilder.py`, `rebase.py`, `references.py`, `refspec.py`, `utils.py`,
|
|
60
|
+
`enums.py`.
|
|
61
61
|
|
|
62
62
|
- **`test/`** — pytest suite with fixture-based repository handling.
|
|
63
63
|
- **`docs/`** — Sphinx documentation (RTD theme).
|
|
@@ -65,7 +65,8 @@ modules:
|
|
|
65
65
|
## Key Configuration Files
|
|
66
66
|
|
|
67
67
|
- **`setup.py`** — setuptools entry point. Builds both the C extension
|
|
68
|
-
(`src/*.c`) and the CFFI extension (`pygit2/_run.py:ffi`).
|
|
68
|
+
(`src/*.c`) and the CFFI extension (`pygit2/_run.py:ffi`). On Windows it
|
|
69
|
+
also copies `git2.dll` into the package (see `BuildWithDLLs`).
|
|
69
70
|
- **`pyproject.toml`** — Build-system requirements, `cibuildwheel`
|
|
70
71
|
configuration, `ruff` settings, and `codespell` settings.
|
|
71
72
|
- **`setup.cfg`** — Legacy pycodestyle configuration.
|
|
@@ -73,7 +74,7 @@ modules:
|
|
|
73
74
|
`testpaths = test/`).
|
|
74
75
|
- **`mypy.ini`** — mypy configuration with strict settings.
|
|
75
76
|
- **`mypy-stubtest.ini`** — mypy configuration for `stubtest` against
|
|
76
|
-
`_pygit2.pyi
|
|
77
|
+
`_pygit2.pyi` (at the repo root).
|
|
77
78
|
- **`requirements.txt`** — Runtime/build requirements (`cffi>=2.0`,
|
|
78
79
|
`setuptools` for Python >= 3.12).
|
|
79
80
|
- **`requirements-test.txt`** — Test requirements (`pytest`, `pytest-cov`).
|
|
@@ -106,16 +107,14 @@ handles libgit2 compilation via CMake.
|
|
|
106
107
|
make
|
|
107
108
|
|
|
108
109
|
# Or manually:
|
|
109
|
-
LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.
|
|
110
|
+
LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.6 sh build.sh
|
|
110
111
|
|
|
111
|
-
# Build
|
|
112
|
-
sh build.sh test
|
|
113
|
-
|
|
114
|
-
# Build a wheel, install it, and run the tests
|
|
112
|
+
# Build a wheel and bundle the shared libraries into it
|
|
115
113
|
sh build.sh wheel
|
|
114
|
+
sh build.sh bundle
|
|
116
115
|
|
|
117
|
-
#
|
|
118
|
-
sh build.sh test
|
|
116
|
+
# Build inplace and run the tests with coverage (build.sh adds --cov=pygit2)
|
|
117
|
+
sh build.sh test
|
|
119
118
|
|
|
120
119
|
# Run mypy type checking
|
|
121
120
|
sh build.sh mypy
|
|
@@ -167,7 +166,12 @@ make -C docs html # requires sphinx-rtd-theme
|
|
|
167
166
|
- Target Python: 3.11+
|
|
168
167
|
- Quote style: single quotes
|
|
169
168
|
- Selected rules: `E4`, `E7`, `E9`, `F`, `I`, `UP035`, `UP007`
|
|
170
|
-
-
|
|
169
|
+
- Run `ruff format` and `ruff check` on changed files before committing.
|
|
170
|
+
CI runs `ruff format --diff` and `ruff check`; formatting failures will
|
|
171
|
+
fail the build.
|
|
172
|
+
- **Type checker**: mypy (strict settings enabled; see `mypy.ini`). Test
|
|
173
|
+
modules additionally require typed defs and calls (`disallow_untyped_defs`,
|
|
174
|
+
`disallow_untyped_calls` under `[mypy-test.*]`).
|
|
171
175
|
- All Python source files must include the standard GPLv2 copyright header.
|
|
172
176
|
- `pygit2/__init__.py` is large because it re-exports a large surface of
|
|
173
177
|
constants and classes; follow existing patterns when adding new public
|
|
@@ -233,23 +237,27 @@ def f(a, b):
|
|
|
233
237
|
GitHub Actions workflows live in `.github/workflows/`:
|
|
234
238
|
|
|
235
239
|
- **`tests.yml`** — Runs on s390x via QEMU (`uraimo/run-on-arch-action`).
|
|
236
|
-
Allowed to fail; see issue #812.
|
|
240
|
+
Allowed to fail (`continue-on-error`); see issue #812.
|
|
237
241
|
- **`lint.yml`** — Runs `ruff format --diff`, `ruff check`, and
|
|
238
242
|
`sh build.sh mypy`.
|
|
239
|
-
- **`wheels.yml`** — Uses `cibuildwheel` to build wheels for Linux
|
|
240
|
-
arm64, ppc64le, musl), macOS (intel, arm64,
|
|
241
|
-
arm64). It also builds an sdist, runs a
|
|
242
|
-
|
|
243
|
+
- **`wheels.yml`** — Uses `cibuildwheel` (`~=3.3`) to build wheels for Linux
|
|
244
|
+
(amd64, arm64, ppc64le and riscv64 via QEMU, musl), macOS (intel, arm64,
|
|
245
|
+
PyPy), and Windows (x64, x86, arm64). It also builds an sdist, runs a
|
|
246
|
+
`twine check` (skipped on version tags), publishes to PyPI, and creates a
|
|
247
|
+
GitHub Release on version tags (`v*`), with release notes parsed from
|
|
248
|
+
`CHANGELOG.md` by `.github/workflows/parse_release_notes.py`.
|
|
243
249
|
- **`codespell.yml`** — Spell checking with the codespell action.
|
|
244
250
|
|
|
245
251
|
The `cibuildwheel` configuration in `pyproject.toml` pins:
|
|
246
252
|
|
|
247
|
-
- `LIBGIT2_VERSION="1.9.
|
|
253
|
+
- `LIBGIT2_VERSION="1.9.6"`
|
|
248
254
|
- `LIBSSH2_VERSION="1.11.1"`
|
|
249
|
-
- `OPENSSL_VERSION="3.5.
|
|
255
|
+
- `OPENSSL_VERSION="3.5.7"`
|
|
250
256
|
|
|
251
|
-
and skips `*musllinux_ppc64le` plus testing on `*-*linux_ppc64le
|
|
252
|
-
`pp*-macosx_arm64`.
|
|
257
|
+
and skips `*musllinux_ppc64le` plus testing on `*-*linux_ppc64le`,
|
|
258
|
+
`*-*linux_riscv64` and `pp*-macosx_arm64`. On Windows it uses the
|
|
259
|
+
`Visual Studio 18 2026` CMake generator for x64/x86 and
|
|
260
|
+
`Visual Studio 17 2022` for ARM64.
|
|
253
261
|
|
|
254
262
|
## Security Considerations
|
|
255
263
|
|
|
@@ -262,6 +270,11 @@ and skips `*musllinux_ppc64le` plus testing on `*-*linux_ppc64le` and
|
|
|
262
270
|
- Valgrind support: see `docs/development.rst` and
|
|
263
271
|
`misc/valgrind-python.supp` for memory-leak debugging instructions.
|
|
264
272
|
|
|
273
|
+
## Git Commits
|
|
274
|
+
|
|
275
|
+
- Commits created by an AI agent must end with the `Assisted-by:` trailer.
|
|
276
|
+
Human-authored commits do not need it.
|
|
277
|
+
|
|
265
278
|
## Useful Notes for Agents
|
|
266
279
|
|
|
267
280
|
- **Do not assume libgit2 is installed globally.** Check for `LIBGIT2` or use
|
|
@@ -275,5 +288,6 @@ and skips `*musllinux_ppc64le` plus testing on `*-*linux_ppc64le` and
|
|
|
275
288
|
extension. Keep it in sync when adding or changing low-level APIs.
|
|
276
289
|
- **Header stub order matters**: `pygit2/_run.py` concatenates `decl/*.h` in a
|
|
277
290
|
fixed list; add new stubs in the correct position if dependencies require it.
|
|
278
|
-
- Run the full test suite
|
|
279
|
-
|
|
291
|
+
- Run the full test suite, type checks, and linting/formatting before
|
|
292
|
+
considering a change complete:
|
|
293
|
+
`sh build.sh test`, `sh build.sh mypy`, `ruff check .`, and `ruff format .`.
|
|
@@ -21,6 +21,7 @@ Authors:
|
|
|
21
21
|
Nick Hynes
|
|
22
22
|
Richard Möhn
|
|
23
23
|
Xu Tao
|
|
24
|
+
Łukasz Langa
|
|
24
25
|
Konstantin Baikov
|
|
25
26
|
Matthew Duggan
|
|
26
27
|
Matthew Gamble
|
|
@@ -30,7 +31,6 @@ Authors:
|
|
|
30
31
|
Sriram Raghu
|
|
31
32
|
Victor Garcia
|
|
32
33
|
Yonggang Luo
|
|
33
|
-
Łukasz Langa
|
|
34
34
|
Patrick Steinhardt
|
|
35
35
|
Petr Hosek
|
|
36
36
|
Tamir Bahar
|
|
@@ -44,6 +44,7 @@ Authors:
|
|
|
44
44
|
Nabijacz Leweli
|
|
45
45
|
Simon Cozens
|
|
46
46
|
Vlad Temian
|
|
47
|
+
WANG Xuerui
|
|
47
48
|
Brodie Rao
|
|
48
49
|
Chad Dombrova
|
|
49
50
|
Lukas Fleischer
|
|
@@ -65,7 +66,6 @@ Authors:
|
|
|
65
66
|
Santiago Perez De Rosso
|
|
66
67
|
Sebastian Thiel
|
|
67
68
|
Thom Wiggers
|
|
68
|
-
WANG Xuerui
|
|
69
69
|
William Manley
|
|
70
70
|
Alexander Linne
|
|
71
71
|
Alok Singhal
|
|
@@ -127,6 +127,7 @@ Authors:
|
|
|
127
127
|
Masud Rahman
|
|
128
128
|
Michael Sondergaard
|
|
129
129
|
Natanael Arndt
|
|
130
|
+
Nick Williams
|
|
130
131
|
Ondřej Nový
|
|
131
132
|
Sarath Lakshman
|
|
132
133
|
Steve Kieffer
|
|
@@ -242,6 +243,7 @@ Authors:
|
|
|
242
243
|
Victor Florea
|
|
243
244
|
Vladimir Rutsky
|
|
244
245
|
Vruyr Gyolchanyan
|
|
246
|
+
William Bowers
|
|
245
247
|
William Schueller
|
|
246
248
|
Wim Jeantine-Glenn
|
|
247
249
|
Yu Jianjian
|
|
@@ -1,3 +1,55 @@
|
|
|
1
|
+
# 1.20.0 (2026-08-08)
|
|
2
|
+
|
|
3
|
+
- New `RemoteCallbacks.custom_headers()`
|
|
4
|
+
[#1465](https://github.com/libgit2/pygit2/pull/1465)
|
|
5
|
+
|
|
6
|
+
- New rebase API: `Repository.rebase_init(...)`, `Repository.rebase_open(...)`,
|
|
7
|
+
`Rebase`, and `RebaseOperation`
|
|
8
|
+
[#1483](https://github.com/libgit2/pygit2/pull/1483)
|
|
9
|
+
|
|
10
|
+
- Fix `Config.snapshot()` for non-repository configs, allow `PathLike` in
|
|
11
|
+
`Config.__init__()`, and improve config documentation
|
|
12
|
+
[#1468](https://github.com/libgit2/pygit2/pull/1468)
|
|
13
|
+
|
|
14
|
+
- Fix `UnicodeDecodeError` with non-UTF-8 file paths in `Repository.status()`,
|
|
15
|
+
`DiffFile.path`, index paths, checkout callbacks, and related APIs
|
|
16
|
+
[#1451](https://github.com/libgit2/pygit2/issues/1451)
|
|
17
|
+
[#1469](https://github.com/libgit2/pygit2/pull/1469)
|
|
18
|
+
|
|
19
|
+
- Fix `enums.CheckoutStrategy.CONFLICT_STYLE_ZDIFF3`, which was mistakenly
|
|
20
|
+
bound to the `DIFF3` constant
|
|
21
|
+
[#1483](https://github.com/libgit2/pygit2/pull/1483)
|
|
22
|
+
|
|
23
|
+
- Fix crashes and reference-lifetime bugs in custom refdb backends
|
|
24
|
+
[#1471](https://github.com/libgit2/pygit2/issues/1471)
|
|
25
|
+
[#1474](https://github.com/libgit2/pygit2/issues/1474)
|
|
26
|
+
[#1475](https://github.com/libgit2/pygit2/issues/1475)
|
|
27
|
+
[#1476](https://github.com/libgit2/pygit2/issues/1476)
|
|
28
|
+
|
|
29
|
+
- Update wheels to libgit2 1.9.6 and OpenSSL 3.5.7
|
|
30
|
+
|
|
31
|
+
- Add riscv64 wheels
|
|
32
|
+
[#1463](https://github.com/libgit2/pygit2/pull/1463)
|
|
33
|
+
|
|
34
|
+
Breaking changes:
|
|
35
|
+
|
|
36
|
+
- Remove deprecated `pygit2.legacyenums` module and `GIT_*` constants,
|
|
37
|
+
use `pygit2.enums` instead
|
|
38
|
+
|
|
39
|
+
- Remove deprecated support for passing `str` to `Repository.merge(...)`,
|
|
40
|
+
pass a `Commit`, `Oid`, or `Reference` object instead
|
|
41
|
+
|
|
42
|
+
- `Repository.merge_file_from_index(...)` now returns `MergeFileResult` by
|
|
43
|
+
default; pass `use_deprecated=True` for the previous string return, now
|
|
44
|
+
deprecated.
|
|
45
|
+
|
|
46
|
+
- Remove deprecated `Remote.ls_remotes(...)`, use `Remote.list_heads(...)`
|
|
47
|
+
instead
|
|
48
|
+
|
|
49
|
+
- Remove `pygit2.to_bytes(...)` and `pygit2.to_str(...)`; they were undocumented
|
|
50
|
+
accidental public APIs
|
|
51
|
+
|
|
52
|
+
|
|
1
53
|
# 1.19.3 (2026-06-13)
|
|
2
54
|
|
|
3
55
|
- Memory fixes
|
pygit2-1.20.0/Makefile
ADDED
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
#
|
|
23
23
|
# sh build.sh
|
|
24
24
|
#
|
|
25
|
-
# Build libgit2 1.9.
|
|
25
|
+
# Build libgit2 1.9.6 (will use libssh2 if available), then build pygit2
|
|
26
26
|
# inplace:
|
|
27
27
|
#
|
|
28
|
-
# LIBGIT2_VERSION=1.9.
|
|
28
|
+
# LIBGIT2_VERSION=1.9.6 sh build.sh
|
|
29
29
|
#
|
|
30
|
-
# Build libssh2 1.11.1 and libgit2 1.9.
|
|
30
|
+
# Build libssh2 1.11.1 and libgit2 1.9.6, then build pygit2 inplace:
|
|
31
31
|
#
|
|
32
|
-
# LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.
|
|
32
|
+
# LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.6 sh build.sh
|
|
33
33
|
#
|
|
34
34
|
# Build inplace and run the tests:
|
|
35
35
|
#
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2010-
|
|
1
|
+
# Copyright 2010-2026 The pygit2 contributors
|
|
2
2
|
#
|
|
3
3
|
# This file is free software; you can redistribute it and/or modify
|
|
4
4
|
# it under the terms of the GNU General Public License, version 2,
|
|
@@ -31,7 +31,7 @@ import os
|
|
|
31
31
|
import typing
|
|
32
32
|
|
|
33
33
|
# High level API
|
|
34
|
-
from . import enums
|
|
34
|
+
from . import enums, utils
|
|
35
35
|
from ._build import __version__
|
|
36
36
|
|
|
37
37
|
# Low level API
|
|
@@ -310,7 +310,6 @@ from .errors import Passthrough, check_error
|
|
|
310
310
|
from .ffi import C, ffi
|
|
311
311
|
from .filter import Filter
|
|
312
312
|
from .index import Index, IndexEntry
|
|
313
|
-
from .legacyenums import *
|
|
314
313
|
from .options import (
|
|
315
314
|
GIT_OPT_ADD_SSL_X509_CERT,
|
|
316
315
|
GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS,
|
|
@@ -361,12 +360,12 @@ from .options import (
|
|
|
361
360
|
option,
|
|
362
361
|
)
|
|
363
362
|
from .packbuilder import PackBuilder
|
|
363
|
+
from .rebase import Rebase, RebaseOperation
|
|
364
364
|
from .remotes import Remote
|
|
365
365
|
from .repository import Repository
|
|
366
366
|
from .settings import Settings
|
|
367
367
|
from .submodules import Submodule
|
|
368
368
|
from .transaction import ReferenceTransaction
|
|
369
|
-
from .utils import to_bytes, to_str
|
|
370
369
|
|
|
371
370
|
# Features
|
|
372
371
|
features = enums.Feature(C.git_libgit2_features())
|
|
@@ -431,32 +430,32 @@ def init_repository(
|
|
|
431
430
|
options.mode = mode
|
|
432
431
|
|
|
433
432
|
if workdir_path:
|
|
434
|
-
workdir_path_ref = ffi.new('char []',
|
|
433
|
+
workdir_path_ref = ffi.new('char []', utils.encode_fs_path(workdir_path))
|
|
435
434
|
options.workdir_path = workdir_path_ref
|
|
436
435
|
|
|
437
436
|
if description:
|
|
438
|
-
description_ref = ffi.new('char []',
|
|
437
|
+
description_ref = ffi.new('char []', utils.encode_string(description))
|
|
439
438
|
options.description = description_ref
|
|
440
439
|
|
|
441
440
|
if template_path:
|
|
442
|
-
template_path_ref = ffi.new('char []',
|
|
441
|
+
template_path_ref = ffi.new('char []', utils.encode_fs_path(template_path))
|
|
443
442
|
options.template_path = template_path_ref
|
|
444
443
|
|
|
445
444
|
if initial_head:
|
|
446
|
-
initial_head_ref = ffi.new('char []',
|
|
445
|
+
initial_head_ref = ffi.new('char []', utils.encode_string(initial_head))
|
|
447
446
|
options.initial_head = initial_head_ref
|
|
448
447
|
|
|
449
448
|
if origin_url:
|
|
450
|
-
origin_url_ref = ffi.new('char []',
|
|
449
|
+
origin_url_ref = ffi.new('char []', utils.encode_string(origin_url))
|
|
451
450
|
options.origin_url = origin_url_ref
|
|
452
451
|
|
|
453
452
|
# Call
|
|
454
453
|
crepository = ffi.new('git_repository **')
|
|
455
|
-
err = C.git_repository_init_ext(crepository,
|
|
454
|
+
err = C.git_repository_init_ext(crepository, utils.encode_fs_path(path), options)
|
|
456
455
|
check_error(err)
|
|
457
456
|
|
|
458
457
|
# Ok
|
|
459
|
-
return Repository(
|
|
458
|
+
return Repository(utils.path_to_str(path))
|
|
460
459
|
|
|
461
460
|
|
|
462
461
|
def clone_repository(
|
|
@@ -531,13 +530,17 @@ def clone_repository(
|
|
|
531
530
|
opts.fetch_opts.depth = depth
|
|
532
531
|
|
|
533
532
|
if checkout_branch:
|
|
534
|
-
checkout_branch_ref = ffi.new(
|
|
533
|
+
checkout_branch_ref = ffi.new(
|
|
534
|
+
'char []', utils.encode_string(checkout_branch)
|
|
535
|
+
)
|
|
535
536
|
opts.checkout_branch = checkout_branch_ref
|
|
536
537
|
|
|
537
538
|
with git_fetch_options(payload, opts=opts.fetch_opts):
|
|
538
539
|
with git_proxy_options(payload, opts.fetch_opts.proxy_opts, proxy):
|
|
539
540
|
crepo = ffi.new('git_repository **')
|
|
540
|
-
err = C.git_clone(
|
|
541
|
+
err = C.git_clone(
|
|
542
|
+
crepo, utils.encode_string(url), utils.encode_fs_path(path), opts
|
|
543
|
+
)
|
|
541
544
|
payload.check_error(err)
|
|
542
545
|
|
|
543
546
|
# Ok
|
|
@@ -560,7 +563,7 @@ def filter_unregister(name: str) -> None:
|
|
|
560
563
|
if FilterList._is_filter_in_use(name):
|
|
561
564
|
raise RuntimeError(f"filter still in use: '{name}'")
|
|
562
565
|
|
|
563
|
-
c_name =
|
|
566
|
+
c_name = utils.encode_string(name)
|
|
564
567
|
err = C.git_filter_unregister(c_name)
|
|
565
568
|
check_error(err)
|
|
566
569
|
|
|
@@ -915,71 +918,11 @@ __all__ = (
|
|
|
915
918
|
'index',
|
|
916
919
|
'Index',
|
|
917
920
|
'IndexEntry',
|
|
918
|
-
'legacyenums',
|
|
919
|
-
'GIT_FEATURE_THREADS',
|
|
920
|
-
'GIT_FEATURE_HTTPS',
|
|
921
|
-
'GIT_FEATURE_SSH',
|
|
922
|
-
'GIT_FEATURE_NSEC',
|
|
923
|
-
'GIT_REPOSITORY_INIT_BARE',
|
|
924
|
-
'GIT_REPOSITORY_INIT_NO_REINIT',
|
|
925
|
-
'GIT_REPOSITORY_INIT_NO_DOTGIT_DIR',
|
|
926
|
-
'GIT_REPOSITORY_INIT_MKDIR',
|
|
927
|
-
'GIT_REPOSITORY_INIT_MKPATH',
|
|
928
|
-
'GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE',
|
|
929
|
-
'GIT_REPOSITORY_INIT_RELATIVE_GITLINK',
|
|
930
|
-
'GIT_REPOSITORY_INIT_SHARED_UMASK',
|
|
931
|
-
'GIT_REPOSITORY_INIT_SHARED_GROUP',
|
|
932
|
-
'GIT_REPOSITORY_INIT_SHARED_ALL',
|
|
933
|
-
'GIT_REPOSITORY_OPEN_NO_SEARCH',
|
|
934
|
-
'GIT_REPOSITORY_OPEN_CROSS_FS',
|
|
935
|
-
'GIT_REPOSITORY_OPEN_BARE',
|
|
936
|
-
'GIT_REPOSITORY_OPEN_NO_DOTGIT',
|
|
937
|
-
'GIT_REPOSITORY_OPEN_FROM_ENV',
|
|
938
|
-
'GIT_REPOSITORY_STATE_NONE',
|
|
939
|
-
'GIT_REPOSITORY_STATE_MERGE',
|
|
940
|
-
'GIT_REPOSITORY_STATE_REVERT',
|
|
941
|
-
'GIT_REPOSITORY_STATE_REVERT_SEQUENCE',
|
|
942
|
-
'GIT_REPOSITORY_STATE_CHERRYPICK',
|
|
943
|
-
'GIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE',
|
|
944
|
-
'GIT_REPOSITORY_STATE_BISECT',
|
|
945
|
-
'GIT_REPOSITORY_STATE_REBASE',
|
|
946
|
-
'GIT_REPOSITORY_STATE_REBASE_INTERACTIVE',
|
|
947
|
-
'GIT_REPOSITORY_STATE_REBASE_MERGE',
|
|
948
|
-
'GIT_REPOSITORY_STATE_APPLY_MAILBOX',
|
|
949
|
-
'GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE',
|
|
950
|
-
'GIT_ATTR_CHECK_FILE_THEN_INDEX',
|
|
951
|
-
'GIT_ATTR_CHECK_INDEX_THEN_FILE',
|
|
952
|
-
'GIT_ATTR_CHECK_INDEX_ONLY',
|
|
953
|
-
'GIT_ATTR_CHECK_NO_SYSTEM',
|
|
954
|
-
'GIT_ATTR_CHECK_INCLUDE_HEAD',
|
|
955
|
-
'GIT_ATTR_CHECK_INCLUDE_COMMIT',
|
|
956
|
-
'GIT_FETCH_PRUNE_UNSPECIFIED',
|
|
957
|
-
'GIT_FETCH_PRUNE',
|
|
958
|
-
'GIT_FETCH_NO_PRUNE',
|
|
959
|
-
'GIT_CHECKOUT_NOTIFY_NONE',
|
|
960
|
-
'GIT_CHECKOUT_NOTIFY_CONFLICT',
|
|
961
|
-
'GIT_CHECKOUT_NOTIFY_DIRTY',
|
|
962
|
-
'GIT_CHECKOUT_NOTIFY_UPDATED',
|
|
963
|
-
'GIT_CHECKOUT_NOTIFY_UNTRACKED',
|
|
964
|
-
'GIT_CHECKOUT_NOTIFY_IGNORED',
|
|
965
|
-
'GIT_CHECKOUT_NOTIFY_ALL',
|
|
966
|
-
'GIT_STASH_APPLY_PROGRESS_NONE',
|
|
967
|
-
'GIT_STASH_APPLY_PROGRESS_LOADING_STASH',
|
|
968
|
-
'GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX',
|
|
969
|
-
'GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED',
|
|
970
|
-
'GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED',
|
|
971
|
-
'GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED',
|
|
972
|
-
'GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED',
|
|
973
|
-
'GIT_STASH_APPLY_PROGRESS_DONE',
|
|
974
|
-
'GIT_CREDENTIAL_USERPASS_PLAINTEXT',
|
|
975
|
-
'GIT_CREDENTIAL_SSH_KEY',
|
|
976
|
-
'GIT_CREDENTIAL_SSH_CUSTOM',
|
|
977
|
-
'GIT_CREDENTIAL_DEFAULT',
|
|
978
|
-
'GIT_CREDENTIAL_SSH_INTERACTIVE',
|
|
979
|
-
'GIT_CREDENTIAL_USERNAME',
|
|
980
|
-
'GIT_CREDENTIAL_SSH_MEMORY',
|
|
981
921
|
'packbuilder',
|
|
982
922
|
'PackBuilder',
|
|
923
|
+
'rebase',
|
|
924
|
+
'Rebase',
|
|
925
|
+
'RebaseOperation',
|
|
983
926
|
'refspec',
|
|
984
927
|
'remotes',
|
|
985
928
|
'Remote',
|
|
@@ -994,8 +937,6 @@ __all__ = (
|
|
|
994
937
|
'transaction',
|
|
995
938
|
'ReferenceTransaction',
|
|
996
939
|
'utils',
|
|
997
|
-
'to_bytes',
|
|
998
|
-
'to_str',
|
|
999
940
|
# __init__ module defined symbols
|
|
1000
941
|
'features',
|
|
1001
942
|
'LIBGIT2_VER',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2010-
|
|
1
|
+
# Copyright 2010-2026 The pygit2 contributors
|
|
2
2
|
#
|
|
3
3
|
# This file is free software; you can redistribute it and/or modify
|
|
4
4
|
# it under the terms of the GNU General Public License, version 2,
|
|
@@ -34,7 +34,7 @@ from pathlib import Path
|
|
|
34
34
|
#
|
|
35
35
|
# The version number of pygit2
|
|
36
36
|
#
|
|
37
|
-
__version__ = '1.
|
|
37
|
+
__version__ = '1.20.0'
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
#
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2010-
|
|
1
|
+
# Copyright 2010-2026 The pygit2 contributors
|
|
2
2
|
#
|
|
3
3
|
# This file is free software; you can redistribute it and/or modify
|
|
4
4
|
# it under the terms of the GNU General Public License, version 2,
|
|
@@ -87,10 +87,36 @@ class GitRepositoryC:
|
|
|
87
87
|
# def _from_c(cls, ptr: 'GitRepositoryC', owned: bool) -> 'Repository': ...
|
|
88
88
|
pass
|
|
89
89
|
|
|
90
|
+
class GitRemoteCallbacksC:
|
|
91
|
+
# TODO: Several Anys need filling in
|
|
92
|
+
version: int
|
|
93
|
+
sideband_progress: Any
|
|
94
|
+
completion: Any
|
|
95
|
+
credentials: Any
|
|
96
|
+
certificate_check: Any
|
|
97
|
+
transfer_progress: Any
|
|
98
|
+
update_tips: Any
|
|
99
|
+
pack_progress: Any
|
|
100
|
+
push_transfer_progress: Any
|
|
101
|
+
push_update_reference: Any
|
|
102
|
+
push_negotiation: Any
|
|
103
|
+
transport: Any
|
|
104
|
+
remote_ready: Any
|
|
105
|
+
payload: Any
|
|
106
|
+
resolve_url: Any
|
|
107
|
+
update_refs: Any
|
|
108
|
+
|
|
90
109
|
class GitFetchOptionsC:
|
|
91
110
|
# TODO: FetchOptions exist in _pygit2.pyi
|
|
92
111
|
# incomplete
|
|
93
112
|
depth: int
|
|
113
|
+
callbacks: GitRemoteCallbacksC
|
|
114
|
+
custom_headers: GitStrrayC
|
|
115
|
+
|
|
116
|
+
class GitPushOptionsC:
|
|
117
|
+
# TODO incomplete
|
|
118
|
+
callbacks: GitRemoteCallbacksC
|
|
119
|
+
custom_headers: GitStrrayC
|
|
94
120
|
|
|
95
121
|
class GitSubmoduleC:
|
|
96
122
|
pass
|
|
@@ -146,6 +172,9 @@ class GitBufC:
|
|
|
146
172
|
class GitCheckoutOptionsC:
|
|
147
173
|
# incomplete
|
|
148
174
|
checkout_strategy: int
|
|
175
|
+
ancestor_label: ArrayC[char]
|
|
176
|
+
our_label: ArrayC[char]
|
|
177
|
+
their_label: ArrayC[char]
|
|
149
178
|
|
|
150
179
|
class GitCommitC:
|
|
151
180
|
pass
|
|
@@ -225,7 +254,11 @@ class GitRepositoryInitOptionsC:
|
|
|
225
254
|
origin_url: ArrayC[char]
|
|
226
255
|
|
|
227
256
|
class GitCloneOptionsC:
|
|
228
|
-
|
|
257
|
+
# TODO: Several Anys need filling in
|
|
258
|
+
repository_cb: Any
|
|
259
|
+
repository_cb_payload: Any
|
|
260
|
+
remote_cb: Any
|
|
261
|
+
remote_cb_payload: Any
|
|
229
262
|
|
|
230
263
|
class GitPackbuilderC:
|
|
231
264
|
pass
|
|
@@ -241,6 +274,22 @@ class GitProxyOptionsC:
|
|
|
241
274
|
# certificate_check
|
|
242
275
|
# payload
|
|
243
276
|
|
|
277
|
+
class GitRebaseC:
|
|
278
|
+
pass
|
|
279
|
+
|
|
280
|
+
class GitRebaseOperationC:
|
|
281
|
+
type: int
|
|
282
|
+
id: GitOidC
|
|
283
|
+
exec: char_pointer
|
|
284
|
+
|
|
285
|
+
class GitRebaseOptionsC:
|
|
286
|
+
version: int
|
|
287
|
+
quiet: int
|
|
288
|
+
inmemory: int
|
|
289
|
+
rewrite_notes_ref: ArrayC[char]
|
|
290
|
+
merge_options: GitMergeOptionsC
|
|
291
|
+
checkout_options: GitCheckoutOptionsC
|
|
292
|
+
|
|
244
293
|
class GitRemoteC:
|
|
245
294
|
pass
|
|
246
295
|
|
|
@@ -256,6 +305,8 @@ def new(a: Literal['git_repository **']) -> _Pointer[GitRepositoryC]: ...
|
|
|
256
305
|
@overload
|
|
257
306
|
def new(a: Literal['git_remote **']) -> _Pointer[GitRemoteC]: ...
|
|
258
307
|
@overload
|
|
308
|
+
def new(a: Literal['git_remote_callbacks *']) -> GitRemoteCallbacksC: ...
|
|
309
|
+
@overload
|
|
259
310
|
def new(a: Literal['git_transaction **']) -> _Pointer[GitTransactionC]: ...
|
|
260
311
|
@overload
|
|
261
312
|
def new(a: Literal['git_repository_init_options *']) -> GitRepositoryInitOptionsC: ...
|
|
@@ -276,8 +327,12 @@ def new(a: Literal['git_blob **']) -> _Pointer[GitBlobC]: ...
|
|
|
276
327
|
@overload
|
|
277
328
|
def new(a: Literal['git_clone_options *']) -> GitCloneOptionsC: ...
|
|
278
329
|
@overload
|
|
330
|
+
def new(a: Literal['git_fetch_options *']) -> GitFetchOptionsC: ...
|
|
331
|
+
@overload
|
|
279
332
|
def new(a: Literal['git_merge_options *']) -> GitMergeOptionsC: ...
|
|
280
333
|
@overload
|
|
334
|
+
def new(a: Literal['git_push_options *']) -> GitPushOptionsC: ...
|
|
335
|
+
@overload
|
|
281
336
|
def new(a: Literal['git_blame_options *']) -> GitBlameOptionsC: ...
|
|
282
337
|
@overload
|
|
283
338
|
def new(a: Literal['git_annotated_commit **']) -> _Pointer[GitAnnotatedCommitC]: ...
|
|
@@ -346,6 +401,12 @@ def new(a: Literal['git_stash_save_options *']) -> GitStashSaveOptionsC: ...
|
|
|
346
401
|
@overload
|
|
347
402
|
def new(a: Literal['git_strarray *']) -> GitStrrayC: ...
|
|
348
403
|
@overload
|
|
404
|
+
def new(a: Literal['git_rebase **']) -> _Pointer[GitRebaseC]: ...
|
|
405
|
+
@overload
|
|
406
|
+
def new(a: Literal['git_rebase_options *']) -> GitRebaseOptionsC: ...
|
|
407
|
+
@overload
|
|
408
|
+
def new(a: Literal['git_rebase_operation **']) -> _Pointer[GitRebaseOperationC]: ...
|
|
409
|
+
@overload
|
|
349
410
|
def new(a: Literal['git_tree **']) -> _Pointer[GitTreeC]: ...
|
|
350
411
|
@overload
|
|
351
412
|
def new(a: Literal['git_buf *'], b: tuple[NULL_TYPE, Literal[0]]) -> GitBufC: ...
|
|
@@ -364,6 +425,8 @@ def new(
|
|
|
364
425
|
a: Literal['char *[]'], b: list[Any]
|
|
365
426
|
) -> ArrayC[char_pointer]: ... # For string arrays
|
|
366
427
|
def addressof(a: object, attribute: str) -> _Pointer[object]: ...
|
|
428
|
+
def new_handle(a: T) -> _Pointer[T]: ...
|
|
429
|
+
def gc(cdata: T, destructor: Any, size: int = ...) -> T: ...
|
|
367
430
|
|
|
368
431
|
class buffer(bytes):
|
|
369
432
|
def __init__(self, a: object) -> None: ...
|
|
@@ -599,7 +599,12 @@ class RefdbBackend:
|
|
|
599
599
|
def has_log(self, ref_name: str, /) -> bool: ...
|
|
600
600
|
def lookup(self, refname: str, /) -> Reference: ...
|
|
601
601
|
def rename(
|
|
602
|
-
self,
|
|
602
|
+
self,
|
|
603
|
+
old_name: str,
|
|
604
|
+
new_name: str,
|
|
605
|
+
force: bool,
|
|
606
|
+
who: Signature,
|
|
607
|
+
message: str | None,
|
|
603
608
|
) -> Reference: ...
|
|
604
609
|
def write(
|
|
605
610
|
self,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2010-
|
|
1
|
+
# Copyright 2010-2026 The pygit2 contributors
|
|
2
2
|
#
|
|
3
3
|
# This file is free software; you can redistribute it and/or modify
|
|
4
4
|
# it under the terms of the GNU General Public License, version 2,
|
|
@@ -74,6 +74,7 @@ h_files = [
|
|
|
74
74
|
'graph.h',
|
|
75
75
|
'index.h',
|
|
76
76
|
'merge.h',
|
|
77
|
+
'rebase.h',
|
|
77
78
|
'net.h',
|
|
78
79
|
'refspec.h',
|
|
79
80
|
'repository.h',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2010-
|
|
1
|
+
# Copyright 2010-2026 The pygit2 contributors
|
|
2
2
|
#
|
|
3
3
|
# This file is free software; you can redistribute it and/or modify
|
|
4
4
|
# it under the terms of the GNU General Public License, version 2,
|
|
@@ -30,7 +30,7 @@ from ._pygit2 import Oid, Repository, Signature
|
|
|
30
30
|
|
|
31
31
|
# Import from pygit2
|
|
32
32
|
from .ffi import C, ffi
|
|
33
|
-
from .utils import GenericIterator
|
|
33
|
+
from .utils import GenericIterator, decode_fs_path
|
|
34
34
|
|
|
35
35
|
if TYPE_CHECKING:
|
|
36
36
|
from ._libgit2.ffi import GitBlameC, GitHunkC, GitSignatureC
|
|
@@ -110,7 +110,7 @@ class BlameHunk:
|
|
|
110
110
|
if not path:
|
|
111
111
|
return None
|
|
112
112
|
|
|
113
|
-
return
|
|
113
|
+
return decode_fs_path(path)
|
|
114
114
|
|
|
115
115
|
|
|
116
116
|
class Blame:
|