You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b018ff9
Browse filesBrowse the repository at this point in the historyBrowse files
refactor!: delegate index state and metadata decoding to Git and Gix
Python previously retained mutable index dictionaries and reconstructed index
files from those entries. That duplicated Git semantics and allowed validation
and publication to diverge. Keep deferred and virtual indexes as opaque bytes;
materialize a private file before Git edits it, verify requested entries survived,
and publish through the existing atomic lock. Replace `IndexFile.entries` with
`iter_entries()` and `entry()` and migrate submodule, tutorial and test callers.
Preserve deferred add/remove and conflict resolution, alternate publication,
index versions and flags, split snapshots, checkout/diff visibility and hook
edits. Failed ordinary edits retain pending and published state. Reject NULs
before encoding stdin records. Keep source containment checks because Python
reads those paths before Git validates the recorded destination.
Use GixPython's structured commit/tag decoders, including signature headers and
encoding, instead of parsing native object bytes. Retain raw CLI commit/tag
metadata decoding where formatted Git output cannot preserve those fields.
Delegate textual date syntax and trailer discovery to Git. Record Gix's unsafe
index insertion, missing date parser and missing strict tag validation as
`GIX-26` through `GIX-28`; private index edits and tag storage use CLI fallbacks.
A native byte round trip alone does not prove Git-compatible validation.
Remove the deprecated `GitDB` selection, API aliases, global shell switch,
automatic environment expansion and Windows error-hiding switches. Keep explicit
shell selection and tilde expansion. Document replacements and changed timezone
and trailer behavior in `doc/source/changes.rst`.
Delete obsolete parser/deprecation tests, repeated rejection matrices and
historical timing-only tests. Retain happy paths, Python glue/security failures,
atomicity and demonstrated compatibility regressions. The maintained benchmark
continues to check parity and CLI process budgets.
Validation on macOS with Git 2.54.0 and GixPython 0.1.0:
- Final retained Gix suite: 1,767 passed, 51 skipped, one expected failure,
and 44 subtests passed. CLI suite: 1,672 passed, 52 skipped, one expected
failure, and 44 subtests passed. The new tag rejection test passed separately
on CLI after that suite collected; final framing/fixture checks passed on
both backends (17 tests each).
- All five cached downstream profiles passed on both backends: Bandit,
DataHub, LangChain, MLflow and SWE-bench.
- All 14 benchmark result digests matched and existing Gix CLI ceilings passed.
Fast timings ran alongside validation and do not establish a speed change.
- `pre-commit`, `ruff`, `mypy`, `basedpyright`, the warnings-as-errors Sphinx
build, and `git diff --check` passed.
Windows/Cygwin and the minimum Git 2.52 were not exercised for this migration.
Removed APIs and corrected date/trailer behavior require caller migration.
|`Commit.iter_items`, `Repo.iter_commits`| First-parent walks and a single tip | General history ordering; GIX-8 |
187
217
| Index entry reads, `ls_files`| Stage/mode/OID/path and exposed index flags | Custom and sparse indexes; GIX-3/4 |
188
218
|`IndexFile.version`, `update_index` query | Native index version | Actual `update-index` mutations |
189
-
|`IndexFile.write`and index persistence | Edit a private native index, publish through the existing lock | Custom, sparse, split, non-v2, unmerged, overlapping, or null-ID entries; GIX-3/4/13 |
190
-
| ODB `store`, managed `hash_object`| Native object hashing/writing with byte-fidelity preflight |Large/nonseekable input and changed serialization; GIX-2/5 |
219
+
|Index editing and `IndexFile.write`| Opaque byte snapshots; atomic locked publication | Private-file edits always use Git: arbitrary native index loading and strict pathname validation are missing; GIX-3/4/13/26|
220
+
| ODB `store`, managed `hash_object`| Native object hashing/writing with byte-fidelity preflight |Tags, large/nonseekable input and changed serialization; GIX-2/5/28|
191
221
|`IndexFile.write_tree`| Native tree editor with child-kind and null-ID validation | Missing non-gitlink children, invalid entries; GIX-7/24 |
192
222
| Tree serialization, `mktree`| Native tree editor with child-kind and null-ID validation | Missing children, unsupported or invalid entries; GIX-7/24 |
193
223
| Fresh index preparation, `read_tree`| Empty index or index from one tree | Existing index, merges, non-v2 selection; GIX-13 |
@@ -738,6 +768,10 @@ identify the historical fixture where needed.
738
768
| GIX-23 | Missing API | No hook lookup or execution API is bound in GixPython 0.1.0. The removed absence fast path read config through Gix but used Python `os.stat()` to declare success. | Bind native hook lookup with configured/default path, linked-worktree, missing/nonexecutable-hook and diagnostic semantics, plus execution where needed. Until then all managed hook calls use Git, including `--ignore-missing` no-ops. A Python filesystem check is not a Gix implementation. |
739
769
| GIX-24 | Bug | In both object formats, `new_commit_as()` accepts a blob as the tree or a parent where `git commit-tree` rejects it. Tree-editor `upsert()`/`write()` accepts object IDs whose actual kinds disagree with blob/tree/gitlink modes; `git mktree --missing` rejects all three tested mismatches. `edit_references_as()` accepts a blob target under `refs/heads/`, rejected by `git update-ref`. | Provide checked commit/tree construction and reference edits, at least in Git-strict mode. Match Git's kind and direct-branch target validation before writing and under the required ref locks, including its distinct handling of symbolic aliases. Existing `_commit_tree`, `_write_tree` and `_update_ref` guards query Gix headers and select CLI on invalid inputs; they do not replace Gix writes with Python. |
740
770
| GIX-25 | Bug; missing API | After `git symbolic-ref refs/heads/dangling refs/heads/missing`, `Repository.references().all()` enumerates the dangling name, while `git for-each-ref --format=%(refname)` omits it. Valid symbolic aliases must remain present. Both SHA-1 and SHA-256 probes reproduce this difference. | Expose Git-compatible enumeration with the same dangling-reference and diagnostic behavior, retaining the raw iterator for callers that need it. `_for_each_ref` forces Gix to resolve symbolic targets and falls back to Git on failure; keep that fallback until a compatible Gix API/mode is verified. |
771
+
| GIX-26 | Bug; missing API |`dangerously_push_entry(IndexStat(), oid, 0, 0o120000, b".gitmodules")`, followed by `sort_entries()`, `verify_entries()` and `write()`, succeeds and retains the unsafe symlink. Protected Git `update-index -z --index-info` ignores it with exit 0 and `Ignoring path .gitmodules`; protected `read-tree` rejects it. The native fresh `index_from_tree` also rejects it. | A Git-strict checked index batch editor that validates names/modes, preserves metadata and reports rejected records. `verify_entries()` verifies ordering, not pathname safety. All private-index edits use Git with `core.protectHFS=true` and `core.protectNTFS=true`, followed by requested-entry readback; no Python dictionary reconstruction or native dangerous insertion remains. |
772
+
| GIX-27 | Missing API |`gix.Time` exposes seconds/offset but no human date parser in GixPython 0.1.0. | Bind Git-compatible textual date parsing with timezone semantics. `parse_date()` uses `git var GIT_AUTHOR_IDENT` with fixed identity and per-command date, then adapts the normalized timestamp/offset. |
773
+
| GIX-28 | Bug; missing API | GixPython 0.1.0 on Gitoxide `f819565c2c4c56619c4888acef6cf3b8144cbccb` stores `object <blob>\ntype blob\ntag invalid\n\nmessage\n` through `write_object("tag", data)`. Git 2.54.0 rejects the same payload through `hash-object -t tag -w --stdin` with `missingTaggerEntry`. Byte-preserving native readback does not establish Git's validation. | Expose a Git-strict tag writer or validation API. Managed tag hashing/storage uses Git before any native write; `test_tag_storage_rejects_missing_tagger` verifies failure and absence from storage. Keep the bug open until upstream validation is verified. |
774
+
741
775
742
776
Windows reproduction for GIX-14 uses CPython 3.12.13, Git
743
777
2.55.0.windows.3 and the released GixPython 0.1.0 source distribution with
Copy file name to clipboardExpand all lines: doc/source/intro.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Overview / Install
6
6
7
7
GitPython is a python library used to interact with git repositories, high-level like git-porcelain, or low-level like git-plumbing.
8
8
9
-
It provides Python objects for repository data and delegates Git operations to the Git executable. The default backend supports both SHA-1 and SHA-256 object IDs and both files and reftable reference storage. The legacy pure-Python GitDB backend remains available but is deprecated.
9
+
It provides Python objects for repository data and delegates Git operations to the Git executable. The default backend supports both SHA-1 and SHA-256 object IDs and both files and reftable reference storage. The legacy pure-Python GitDB backend is removed.
10
10
11
11
The object database implementation is optimized for handling large quantities of objects and large datasets, which is achieved by using low-level structures and data streaming.
12
12
@@ -15,7 +15,7 @@ Requirements
15
15
16
16
* `Python`_ >= 3.8
17
17
* `Git`_ 2.52 or newer
18
-
* `GitDB`_ - shared data types and the deprecated legacy object database
Copy file name to clipboardExpand all lines: doc/source/tutorial.rst
+4-15Lines changed: 4 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -341,7 +341,7 @@ As trees allow direct access to their intermediate child entries only, use the t
341
341
342
342
The Index Object
343
343
****************
344
-
The git index is the stage containing changes to be written with the next commit or where merges finally have to take place. You may access and manipulate semantic entries (mode, object ID, path, and stage) using the :class:`IndexFile <git.index.base.IndexFile>` object. Git reads and writes the underlying index; raw stat fields and binary index extensions are not exposed.
344
+
The git index is the stage containing changes to be written with the next commit or where merges finally have to take place. Use :meth:`IndexFile.iter_entries <git.index.base.IndexFile.iter_entries>` and :meth:`IndexFile.entry <git.index.base.IndexFile.entry>` to query immutable entry records (mode, object ID, path, and stage); use ``add`` and ``remove`` to edit them. Deferred edits retain opaque index-file bytes. Git reads and writes the underlying index; raw stat fields and binary index extensions are not exposed.
0 commit comments