Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
cc51d12
feat!: use guarded Git commands for repository storage
codex Oct 1, 2026
427dc41
ci: build supported Git for Cygwin tests
codex Oct 1, 2026
c935506
test: handle symlinked Git directories in refresh checks
codex Oct 1, 2026
2df22e8
fix: preserve repository and object paths across platforms
codex Oct 1, 2026
ea767d5
test: cover Cygwin index filename restrictions
codex Oct 1, 2026
f954793
test: preserve hidden gitfiles when preparing submodule aliases
codex Oct 1, 2026
7453896
test: clean up read-only submodule object files on Windows
codex Oct 1, 2026
7ff0a87
fix(submodule): close repositories owned by update operations
codex Oct 1, 2026
889f213
ci: install supported Git in the normal Cygwin layout
codex Oct 1, 2026
bf27f8b
test(downstream): run released Bandit baseline tests against this che…
codex Oct 1, 2026
24c3ca4
test(downstream): validate the latest MLflow Git integration
codex Oct 1, 2026
25cefa9
test(downstream): exercise released LangChain GitLoader integration
codex Oct 1, 2026
e0171d8
test(downstream): cover SWE-bench cloning across Git storage formats
codex Oct 1, 2026
bdd6be4
test(downstream): run DataHub Git integration for its latest release
codex Oct 1, 2026
6a9cb4f
feat(gix): select the released backend through an installation extra
codex Oct 1, 2026
22f2ca9
feat(gix): read object headers with native lookup
codex Oct 1, 2026
3b8015f
feat(gix): stream small objects from native storage
codex Oct 1, 2026
b60c3e7
feat(gix): resolve revisions and repository metadata natively
codex Oct 1, 2026
c43175a
feat(gix): enumerate tree entries natively
codex Oct 1, 2026
1af0f6f
feat(gix): resolve symbolic reference targets natively
codex Oct 1, 2026
36c9af1
feat(gix): enumerate reference names natively
codex Oct 1, 2026
2afb498
feat(gix): query merged repository configuration natively
codex Oct 1, 2026
5b60175
feat(gix): list worktree metadata natively
codex Oct 1, 2026
cb0c391
feat(gix): find merge bases and test ancestry natively
codex Oct 1, 2026
908183e
feat(gix): count reachable commits natively
codex Oct 1, 2026
2f44fc4
feat(gix): iterate first-parent commit history natively
codex Oct 1, 2026
d375802
feat(gix): read index entries natively
codex Oct 1, 2026
3aa19b5
feat(gix): query the index version natively
codex Oct 1, 2026
cfb7543
feat(gix): hash and store objects natively
codex Oct 1, 2026
e23e20a
feat(gix): write index trees with the native editor
codex Oct 1, 2026
9fbdb4f
feat(gix): serialize trees with native object storage
codex Oct 1, 2026
fbd48eb
feat(gix): initialize private indexes from trees natively
codex Oct 1, 2026
2444ec7
feat(gix): persist index edits through native snapshots
codex Oct 1, 2026
fb17ed1
feat(gix): create unsigned UTF-8 commits natively
codex Oct 1, 2026
bab4aaa
feat(gix): read reference logs natively
codex Oct 1, 2026
57a4c79
feat(gix): resolve committer identity natively
codex Oct 1, 2026
6c69dec
feat(gix): update supported reference targets natively
codex Oct 1, 2026
e53abf3
feat(gix): compute raw tree diffs natively
codex Oct 1, 2026
2ea09f8
feat(gix): compute commit statistics natively
codex Oct 1, 2026
8a4ba4f
feat(gix): discover untracked files natively
codex Oct 1, 2026
9d62798
feat(gix): check ignored paths natively
codex Oct 1, 2026
7357193
feat(gix): check repository dirtiness natively
codex Oct 1, 2026
d67b46c
build(gix): preserve the extra in local source distributions
codex Oct 1, 2026
dc3d65f
fix(gix): omit dangling symbolic references from enumeration
codex Oct 1, 2026
9b1dd6f
fix(gix): defer compatibility object formats to Git
codex Oct 1, 2026
6d7490d
docs(gix): document release setup and native conversion gaps
codex Oct 1, 2026
64e7256
test: avoid repository setup for actor and exception tests
codex Oct 6, 2026
968b883
test: prepare historical dependency sources once on demand
codex Oct 6, 2026
d72ffb3
test: copy prepared submodule baselines for each case
codex Oct 6, 2026
a467e99
test: reuse prepared submodule rejection layouts
codex Oct 6, 2026
75ba2c3
test: reuse a prepared revision graph with isolated copies
codex Oct 6, 2026
f0ee0d3
test: read historical trees without cloning a checkout
codex Oct 6, 2026
14e0c11
test: copy prepared no-fetch source and submodule repositories
codex Oct 6, 2026
2da7cd1
docs: record fixture optimization validation and suite timings
codex Oct 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 0 additions & 144 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,75 +8,9 @@
"endColumn": 45,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 41,
"endColumn": 48,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 32,
"endColumn": 39,
"lineCount": 1
}
},
{
"code": "reportCallIssue",
"range": {
"startColumn": 25,
"endColumn": 46,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 30,
"endColumn": 39,
"lineCount": 1
}
}
],
"./git/db.py": [
{
"code": "reportIncompatibleMethodOverride",
"range": {
"startColumn": 8,
"endColumn": 12,
"lineCount": 1
}
},
{
"code": "reportIncompatibleMethodOverride",
"range": {
"startColumn": 8,
"endColumn": 14,
"lineCount": 1
}
}
],
"./git/index/base.py": [
{
"code": "reportArgumentType",
"range": {
"startColumn": 30,
"endColumn": 36,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 28,
"endColumn": 34,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
Expand Down Expand Up @@ -186,14 +120,6 @@
"endColumn": 25,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 52,
"endColumn": 84,
"lineCount": 1
}
}
],
"./git/objects/tag.py": [
Expand Down Expand Up @@ -274,32 +200,6 @@
}
}
],
"./git/refs/log.py": [
{
"code": "reportArgumentType",
"range": {
"startColumn": 30,
"endColumn": 34,
"lineCount": 1
}
},
{
"code": "reportAttributeAccessIssue",
"range": {
"startColumn": 17,
"endColumn": 22,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 28,
"endColumn": 30,
"lineCount": 1
}
}
],
"./git/refs/reference.py": [
{
"code": "reportIncompatibleVariableOverride",
Expand All @@ -310,16 +210,6 @@
}
}
],
"./git/refs/symbolic.py": [
{
"code": "reportAttributeAccessIssue",
"range": {
"startColumn": 15,
"endColumn": 20,
"lineCount": 1
}
}
],
"./git/refs/tag.py": [
{
"code": "reportIncompatibleMethodOverride",
Expand All @@ -339,22 +229,6 @@
}
],
"./git/remote.py": [
{
"code": "reportAttributeAccessIssue",
"range": {
"startColumn": 26,
"endColumn": 38,
"lineCount": 1
}
},
{
"code": "reportAttributeAccessIssue",
"range": {
"startColumn": 26,
"endColumn": 38,
"lineCount": 1
}
},
{
"code": "reportAttributeAccessIssue",
"range": {
Expand All @@ -373,14 +247,6 @@
}
],
"./git/repo/base.py": [
{
"code": "reportReturnType",
"range": {
"startColumn": 15,
"endColumn": 28,
"lineCount": 1
}
},
{
"code": "reportTypedDictNotRequiredAccess",
"range": {
Expand Down Expand Up @@ -446,16 +312,6 @@
}
}
],
"./git/repo/fun.py": [
{
"code": "reportReturnType",
"range": {
"startColumn": 11,
"endColumn": 20,
"lineCount": 1
}
}
],
"./test/deprecation/test_basic.py": [
{
"code": "reportUnusedExpression",
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/cygwin-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,25 @@ jobs:
- name: Install Cygwin
uses: cygwin/cygwin-install-action@v6
with:
packages: curl git python39 python-setuptools-wheel
packages: >-
curl gcc-core git libcurl-devel libexpat-devel libiconv-devel
libssl-devel make python39 python-setuptools-wheel zlib-devel
add-to-path: false # No need to change $PATH outside the Cygwin environment.

- name: Arrange for verbose output
run: |
# Arrange for verbose output but without shell environment setup details.
echo 'set -x' >~/.bash_profile

- name: Build minimum supported Cygwin Git
run: |
# Cygwin's packaged Git is older than our minimum supported version.
git clone --depth 1 --branch v2.52.0 -- https://github.com/git/git.git /tmp/git-source
# Use Cygwin's normal prefix: GitPython checks for uname next to git.
make -C /tmp/git-source -j2 prefix=/usr NO_GETTEXT=YesPlease NO_TCLTK=YesPlease NO_PERL=YesPlease install
hash -r
test "$(git version)" = 'git version 2.52.0'

- name: Special configuration for Cygwin git
run: |
git config --global --add safe.directory "$(pwd)"
Expand Down Expand Up @@ -87,6 +98,9 @@ jobs:
run: |
pip install ./smmap ./gitdb '.[test]'

- name: Verify Cygwin Git detection
run: python -c 'from git import Git; assert Git.is_cygwin()'

- name: Show POSIX file ownership
# Cygwin's `ls -ld` reports the NTFS Owner SID via Cygwin's SID-to-uid
# mapping (well-known SIDs by their RID, machine-local accounts by
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Downstream compatibility

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
project: [langchain, mlflow, bandit, swebench, datahub]
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Ensure Git 2.52 or newer
run: |
if ! dpkg --compare-versions "$(git version | awk '{print $3}')" ge 2.52; then
sudo add-apt-repository --yes ppa:git-core/ppa
sudo apt-get update
sudo apt-get install --yes git
fi
- name: Install uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: '0.12.13'
enable-cache: false
- name: Test latest release against this checkout
run: uv run test/downstream/run.py "${{ matrix.project }}"
42 changes: 42 additions & 0 deletions .github/workflows/git-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Minimum Git CLI

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
git-2-52:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v7
with:
repository: git/git
ref: v2.52.0
path: .git-source
- uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Build minimum supported Git
working-directory: .git-source
run: |
make -j2 prefix="$RUNNER_TEMP/git" NO_GETTEXT=YesPlease NO_TCLTK=YesPlease NO_PERL=YesPlease NO_CURL=YesPlease install
echo "$RUNNER_TEMP/git/bin" >> "$GITHUB_PATH"
- name: Install GitPython and test dependencies
run: python -m pip install ./smmap ./gitdb '.[test]'
- name: Verify native format and safety contracts
env:
GIT_CONFIG_NOSYSTEM: '1'
GIT_CONFIG_GLOBAL: /dev/null
GIT_AUTHOR_NAME: GitPython Tests
GIT_AUTHOR_EMAIL: tests@example.invalid
GIT_COMMITTER_NAME: GitPython Tests
GIT_COMMITTER_EMAIL: tests@example.invalid
run: |
git version
python -m pytest --no-cov --tb=short test/test_cli_objects_index.py test/test_cli_safety.py test/test_reflog.py test/test_config.py test/test_remote_cli.py test/test_submodule.py::test_submodule_cli_lifecycle
13 changes: 13 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ jobs:
with:
wsl-version: 1

- name: Install current Git (Linux)
if: matrix.os-type == 'ubuntu'
run: |
sudo add-apt-repository --yes ppa:git-core/ppa
sudo apt-get update
sudo apt-get install --yes git

- name: Install current Git (macOS)
if: matrix.os-type == 'macos'
run: |
brew install git
echo "$(brew --prefix git)/bin" >> "$GITHUB_PATH"

- name: Prepare this repo for tests
run: |
./init-tests-after-clone.sh
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ include LICENSE
include README.md
include VERSION
include requirements.txt
include gix-requirements.txt
include test-requirements.txt
include git/py.typed

Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ probably the skills to scratch that itch of mine: implement `git` in a way that
If you like the idea and want to learn more, please head over to [gitoxide](https://github.com/Byron/gitoxide), an
implementation of 'git' in [Rust](https://www.rust-lang.org).

*(Please note that `gitoxide` is not currently available for use in Python, and that Rust is required.)*
The experimental `GitPython[gix]` extra uses the local GixPython bindings for
supported operations, with automatic Git CLI fallback. See the
[local installation, test commands, and conversion ledger](doc/gix-backend.md).
GixPython is not yet available on PyPI.

## GitPython

Expand All @@ -40,10 +43,10 @@ The project is open to contributions of all kinds, as well as new maintainers.
### REQUIREMENTS

GitPython needs the `git` executable to be installed on the system and available in your
`PATH` for most operations. If it is not in your `PATH`, you can help GitPython find it
`PATH` for repository operations. If it is not in your `PATH`, you can help GitPython find it
by setting the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable.

- Git (1.7.x or newer)
- Git (2.52 or newer)
- Python >= 3.8

The list of dependencies are listed in [`./requirements.txt`](https://github.com/gitpython-developers/GitPython/blob/main/requirements.txt) and [`./test-requirements.txt`](https://github.com/gitpython-developers/GitPython/blob/main/test-requirements.txt).
Expand Down
Loading
Loading