|
2 | 2 | Changelog |
3 | 3 | ========= |
4 | 4 |
|
| 5 | +Unreleased: Git CLI migration |
| 6 | +============================= |
| 7 | + |
| 8 | +GitPython now delegates repository discovery, references, configuration, object |
| 9 | +storage, tree construction, index operations, and revision parsing to Git. The |
| 10 | +default backend supports SHA-1 and SHA-256 repositories with either files or |
| 11 | +reftable reference storage. Repository object IDs must no longer be assumed to |
| 12 | +contain 20 binary bytes or 40 hexadecimal characters. |
| 13 | +Legacy class-level ``NULL_BIN_SHA`` and ``NULL_HEX_SHA`` constants retain their |
| 14 | +SHA-1 values; do not use their width to interpret repository object IDs. |
| 15 | + |
| 16 | +Git executable and safety |
| 17 | +------------------------- |
| 18 | + |
| 19 | +* Git **2.52 or newer** is required for library-managed operations. Older versions |
| 20 | + raise ``UnsupportedOperation`` before repository mutation; there is no Python |
| 21 | + implementation fallback. ``GIT_PYTHON_GIT_EXECUTABLE`` still selects Git. |
| 22 | +* Every managed command uses argument sequences without a shell. Existing unsafe |
| 23 | + option/protocol checks remain, and operands and stdin records receive additional |
| 24 | + validation. NUL-delimited ``cat-file`` requests prevent newline injection. |
| 25 | + Previously accepted option-like revision/ref arguments can now be rejected. |
| 26 | +* New plumbing calls suppress implicit hooks, filesystem monitors, automatic |
| 27 | + maintenance, and lazy network fetches. Index staging continues to store raw |
| 28 | + content rather than introduce clean filters. Diffs disable external diff and |
| 29 | + text conversion programs; blame disables text conversion unless unsafe options |
| 30 | + are explicitly enabled. Explicit commit hooks use ``git hook run`` and honor |
| 31 | + ``skip_hooks``; Git combines their output, so ``HookExecutionError`` may carry |
| 32 | + former stdout text in stderr. Trailer additions reject executable trailer |
| 33 | + configuration instead of invoking it. |
| 34 | +* Existing working-tree conversions retain Git's behavior: status and working-tree |
| 35 | + diffs can run configured clean filters; checkout, clone, and archive can run |
| 36 | + smudge filters. Archive defaults to Git's built-in formats and internal gzip; |
| 37 | + custom format commands require ``allow_unsafe_options=True``. Tag creation |
| 38 | + suppresses configured signing by default; signing, verification, and editor |
| 39 | + options require the same opt-in. |
| 40 | +* The raw ``repo.git`` interface remains available for direct Git commands. |
| 41 | + Existing explicit unsafe-option and unsafe-protocol opt-ins remain independent. |
| 42 | + They do not permit argument or stdin-record injection, or reordering command |
| 43 | + options past the library's safety flags. |
| 44 | +* Known command outcomes retain established GitPython/configparser exceptions |
| 45 | + where distinguishable. Other failures raise ``GitCommandError`` with Git's |
| 46 | + exit status and diagnostic output; exact error text may differ. |
| 47 | + |
| 48 | +API changes |
| 49 | +----------- |
| 50 | + |
| 51 | +* ``GitCmdObjectDB`` no longer inherits ``LooseObjectDB``. Its object reads, |
| 52 | + writes, existence checks, and enumeration use Git, including packed objects. |
| 53 | + Precompressed input streams and custom object-output writers are unsupported. |
| 54 | + The deprecated ``GitDB`` remains explicitly selectable with its existing |
| 55 | + warning and limitations; ``gitdb`` remains a dependency for shared types. |
| 56 | +* ``Repo.object_format`` and ``Repo.ref_format`` report Git's storage formats. |
| 57 | + ``Repo.alternates`` is read-only and reports effective absolute alternate |
| 58 | + directories, including environment and transitive alternates. Direct editing |
| 59 | + of the alternates file through this property is removed. |
| 60 | +* Index entries retain their mode, object ID, path, and stage. Raw stat fields, |
| 61 | + arbitrary cache flags/extensions/checksums, ``IndexFileSHA1Writer``, and the |
| 62 | + standalone binary index read/write/merge helpers are removed. Use |
| 63 | + ``IndexFile.from_tree()``, ``IndexFile.new()``, ``write()`` and ``write_tree()``. |
| 64 | + Git preserves untouched metadata when an existing index is edited. Temporary |
| 65 | + indexes isolate tree/merge operations from the real index and working tree. |
| 66 | + ``version`` is read-only. ``from_tree()`` accepts ``trivial``, ``aggressive``, |
| 67 | + and ``verbose`` options; arbitrary ``read-tree`` keyword forwarding is removed. |
| 68 | +* Standalone binary tree parsers, serializers, and multi-tree traversal helpers |
| 69 | + are removed. Use ``Tree`` traversal/cache operations and the index interface. |
| 70 | + Tree/commit serialization adapters that remain write their objects to the |
| 71 | + repository to obtain Git-produced bytes. |
| 72 | + Commit creation preserves message bytes through plain stdin. Injecting or |
| 73 | + reusing arbitrary ``gpgsig`` headers is unsupported; modified signed commits |
| 74 | + become unsigned. |
| 75 | +* ``RefLog`` is associated with a reference, not a filesystem path. Keep using |
| 76 | + ``ref.log()``, ``ref.log_entry()`` and ``ref.log_append()``. ``RefLogEntry`` now |
| 77 | + contains ``newhexsha``, ``actor``, ``time`` and ``message``; ``oldhexsha`` and |
| 78 | + the old tuple layout are removed. Reads follow Git's commit-reflog view, which |
| 79 | + omits entries targeting non-commit or unavailable objects. Old IDs are never |
| 80 | + inferred from adjacent entries. Raw reflog file/stream read, write, and rewrite |
| 81 | + APIs are removed. Reference updates follow Git's reflog creation/update rules, |
| 82 | + including updates when ``logmsg`` is omitted. |
| 83 | +* ``GitConfigParser`` uses Git's configuration syntax and canonical key spelling, |
| 84 | + and no longer subclasses ``configparser.RawConfigParser``. |
| 85 | + Common getters, typed values, duplicate values, file/stream inputs and mutation |
| 86 | + methods remain. Invalid Git syntax previously accepted by Python is rejected. |
| 87 | + Empty-section creation and valueless writes are removed; valueless reads remain. |
| 88 | + Relative includes from streams are rejected by Git. Locks cover each native |
| 89 | + mutation rather than the writer object's lifetime. |
| 90 | +* ``Submodule.rename()`` is removed. Moving a submodule preserves its logical name, |
| 91 | + matching Git. Normal removal retains Git's recoverable submodule metadata. |
| 92 | + Re-adding with ``no_checkout=True`` can reuse that metadata without changing refs; |
| 93 | + incompatible URLs, branches, and clone-only options are rejected before mutation. |
| 94 | + Fetch/pull results are derived from command output rather than ``FETCH_HEAD`` |
| 95 | + file parsing. Revision strings follow Git's native revision grammar. |
| 96 | + |
5 | 97 | 3.2.0 |
6 | 98 | ===== |
7 | 99 |
|
|
0 commit comments