Repository navigation
Commit 0442cf8
feat!: delegate repository storage to Git and Gix
GitPython's Python implementations of repository discovery, configuration,
references, object storage and indexes assume storage details that do not hold
for SHA-256 objects or reftable references. Delegate these operations to Git
2.52+ and offer GixPython 0.2.0 for supported operations, using the Git CLI as
the behavioral baseline.
Keep library-managed commands behind argument and stdin validation, suppress
implicit hooks, external diff programs, maintenance and lazy fetches where
appropriate, and preserve explicit unsafe-operation opt-ins. Support SHA-1 and
SHA-256 with files or reftable reference storage. Close owned repository handles
before filesystem cleanup and account for Windows and Cygwin path restrictions.
The optional `gix` extra selects Gitoxide through supported GixPython APIs.
`GIT_PYTHON_BACKEND=cli|gix` makes selection explicit even when both backends are
installed. Retain native repository handles and adapt native object, reference,
index, graph, configuration, diff and status results where they match Git.
Keep CLI fallbacks for missing capabilities and incompatible behavior; record
reproductions, affected adapters and upstream requirements in the compatibility
ledger in `doc/gix-backend.md`. Native execution never means reimplementing Git
semantics in Python.
Read declared commit encodings according to Git's first-header and whole-commit
conversion behavior, including conversion failure and signature headers. Keep
UTF-8 metadata native; use Git's text projection for other encodings and the
open Gix header-order compatibility bug. Validate these cases with read-only
Bash fixtures and direct Git comparisons. Configuration failure regressions
exercise Git's per-mutation locks rather than the removed constructor lock.
Breaking API changes follow the storage migration. Remove the Python `GitDB`
backend and binary index/tree and raw reflog mutation interfaces. Replace
`IndexFile.entries` with immutable `iter_entries()`/`entry()` queries and explicit
edits; publish deferred index bytes only after Git validates them. Configuration
uses Git's syntax and locking, reflogs expose Git's commit-reflog view, and
repository object IDs have format-dependent widths. Remove deprecated exports
and implicit environment-variable path expansion. Document the affected APIs,
exceptions, hook behavior and replacements in `doc/source/changes.rst`.
Move generated repository and filesystem initial states into Bash scripts run
through `gix.testtools`. Read-only tests share prepared fixtures; mutation tests
copy them by default, with explicit execution only for fixtures that cannot be
relocated. Keep generated caches and archives out of version control. Tests
require GixPython with either backend: CI runs fixture suites on Python 3.11+
and retains installation/import smoke checks on Python 3.8-3.10. Update the
normal, minimum-Git, Alpine and Cygwin environments and the source packaging.
Add downstream release checks for Bandit, MLflow, LangChain, SWE-bench and
DataHub with both backends. Add a read-only repository benchmark that compares
result digests, records native/fallback decisions and actual Git launches, and
enforces CLI-process ceilings. Preserve historical measurements and their
original revision references as evidence, including superseded results.
Validation on macOS with CPython 3.12.14, Git 2.54.0 and GixPython 0.2.0:
the full CLI suite passed 1,745 tests with 151 skips, and the full Gix suite
passed 1,845 tests with 51 skips. Both passed 58 subtests and retained one
expected failure. CLI ran first. All 14 benchmark result digests and the
existing CLI-process ceilings matched; the two-sample smoke run establishes
no timing conclusion. Ruff lint/format, mypy, basedpyright, ShellCheck and
Sphinx with warnings fatal passed. Hosted CI, other platforms and older
interpreters were not run locally.
Co-authored-by: GPT-6 Astra <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Byron <sebastian.thiel@icloud.com>1 parent 563cb1f commit 0442cf8
162 files changed
Lines changed: 13599 additions & 13019 deletions
File tree
- .basedpyright
- .github/workflows
- doc
- source
- fuzzing
- fuzz-targets
- local-dev-helpers
- oss-fuzz-scripts
- git
- index
- objects
- submodule
- refs
- repo
- tests/fixtures
- test
- deprecation
- downstream
- checks
- lib
- performance
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 11 | | |
62 | 12 | | |
63 | 13 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | 14 | | |
81 | 15 | | |
82 | 16 | | |
| |||
186 | 120 | | |
187 | 121 | | |
188 | 122 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | 123 | | |
198 | 124 | | |
199 | 125 | | |
| |||
274 | 200 | | |
275 | 201 | | |
276 | 202 | | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | 203 | | |
304 | 204 | | |
305 | 205 | | |
| |||
310 | 210 | | |
311 | 211 | | |
312 | 212 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | 213 | | |
324 | 214 | | |
325 | 215 | | |
| |||
338 | 228 | | |
339 | 229 | | |
340 | 230 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | 231 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | 232 | | |
385 | 233 | | |
386 | 234 | | |
| |||
445 | 293 | | |
446 | 294 | | |
447 | 295 | | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | 296 | | |
469 | 297 | | |
470 | 298 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | | - | |
27 | | - | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
0 commit comments