Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openSUSE-Python/GitPython
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: gitpython-developers/GitPython
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 14 commits
  • 60 files changed
  • 5 contributors

Commits on Nov 3, 2026

  1. fix: read reference arguments by exact name in revision APIs

    <!-- agent -->
    `Reference.__str__` returns the short name, so `refs/heads/main` becomes
    `main` and `refs/remotes/origin/main` becomes `origin/main`. The revision
    APIs turned reference objects into revisions with `str(ref)` or
    `Git._check_operand(ref, "revision")`, and Git's revision lookup
    (gitrevisions(7)) tries `refs/tags/<name>` before `refs/heads/<name>` and
    `refs/remotes/<name>`, only warning about the ambiguity on stderr. A tag
    that shares a branch's short name therefore took the branch's place.
    Whoever controls a remote can supply such tags: `git fetch` auto-follows
    tags that point into fetched history, and a clone brings in every tag.
    
    With a branch `main` and fetched tags `main` and `origin/main` on another
    commit, `repo.heads.main.commit` still reported the branch, but these APIs
    used the tag's commit on both backends:
    
    - `Repo.commit()`, `Repo.tree()`, `Object.new()`, `Repo.iter_commits()`
    - `Repo.merge_base()`, `Repo.is_ancestor()`, `Diffable.diff()`
    - `Repo.blame()`, `Repo.blame_incremental()`, `Repo.archive()`
    - `IndexFile.from_tree()`, `IndexFile.merge_tree()`, `IndexFile.reset()`
    - `HEAD.reset()`, `Repo.create_head()`, `Repo.create_tag()`
    
    In the documented merge workflow, `merge_base(new_branch, original_branch)`
    followed by `index.merge_tree(original_branch, base=...)`, the merge commit
    received the tag's tree while its parents named the branch commits.
    `repo.head.reset(repo.heads.main, working_tree=True)` and
    `repo.index.reset(ref, head=True)` moved the current branch to the tag's
    commit and wrote its files into the working tree.
    
    Add `Git._check_revision()`. For a `SymbolicReference` it reads the exact
    reference through `dereference_recursive()`, the `show-ref`/Gix read behind
    `ref.object`, and passes on the object ID, which is how
    `SymbolicReference.set_object()` already resolves reference arguments.
    Strings keep Git's name guessing, as the changelog already documents.
    `merge_base()` resolves its top-level arguments before
    `_unpack_args()` flattens them. A reference that does not exist now raises
    `ValueError`, as `ref.object` does, instead of resolving to whatever Git
    guesses for its short name. On the CLI backend each reference argument
    costs one or two extra short Git calls; the Gix backend reads references
    natively, and `doc/gix-backend.md` is unchanged.
    
    Validation: the new `shadowed` case in `tests/fixtures/exact-refs.sh` backs
    `test_reference_arguments_do_not_resolve_same_named_tags` in
    `test/test_refs.py`, which checks the APIs above for a branch and a
    remote-tracking branch. It fails before the change and passes after it with
    `GIT_PYTHON_BACKEND=cli` and `GIT_PYTHON_BACKEND=gix` for SHA-1/SHA-256 and
    files/reftable (Git 2.52.0, GixPython 0.3.0, Python 3.11, macOS). Full
    suites with the change: CLI 1,915 passed and Gix 2,018 passed. Each run
    also had 116 failures, and the same 116 tests fail on the unpatched tree;
    they need history and tags such as `0.1.5`, which this shallow clone lacks.
    `ruff check`, `ruff format --check`, ShellCheck, `mypy --python-version=3.11`
    and `basedpyright --warnings` pass.
    
    Agent-Model: claude-opus-5-5
    Keerthana-64 committed Nov 3, 2026
    Configuration menu
    Copy the full SHA
    d03d3d7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2524e95 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2026

  1. fix(refs): preserve full reference names in revision APIs

    <!-- agent: Codex -->
    
    Converting reference arguments to object IDs prevents same-named tags from
    replacing branches, but loses the reference identity required by several Git
    operations. Reflog walks then return no commits, fork-point lookup fails with
    `No such ref`, and the default `upload-archive` server rejects the literal ID.
    References inside nested `merge_base()` arguments also still became short names
    and could select a shadowing tag.
    
    Keep the exact-reference existence and symbolic-chain checks in
    `Git._check_revision()`, then pass the validated full ref name. This preserves
    Git's ref-dependent behavior without operation-specific conversion switches.
    Strings retain Git's revision interpretation and commit objects retain their
    IDs. Normalize `os.PathLike` operands through `os.fsdecode()` before validation
    so their filesystem paths, including byte paths, are used instead of their
    display strings. Flatten nested list/tuple merge-base arguments while preserving
    reference objects until each operand is validated.
    
    Extend `tests/fixtures/exact-refs.sh` with an upstream advance and rewind plus
    a topic based on its old tip. Regressions compare branch, remote-tracking and
    HEAD behavior with Git 2.54.0 across SHA-1/SHA-256 and files/reftable repositories.
    They cover shadowing tags, missing refs, nested operands, option spellings,
    remote archives and safe/unsafe `PathLike` values. Update the changelog and
    document the retained CLI fallbacks: GixPython 0.3.0 exposes neither the required
    reflog-walk/fork-point operations nor an upload-archive client.
    
    Assisted-by: GPT 6.1 Sol
    Co-authored-by: GPT 6.1 Sol <codex@openai.com>
    Byron and codex committed Nov 4, 2026
    Configuration menu
    Copy the full SHA
    6de90f1 View commit details
    Browse the repository at this point in the history
  2. test: mark network-dependent tests for restricted builders

    <!-- aent -->
    SUSE and openSUSE package builders disable network access for reproducible
    builds. Allow them to exclude network-using tests with
    `pytest -m 'not net'` while retaining local filesystem tests.
    
    Register `net` in `pyproject.toml` and document in `CONTRIBUTING.md`
    that it includes loopback sockets and fixture-triggered package downloads,
    not just internet access. Mark the daemon-based repository tests, stalled
    remote timeout cases, daemon restart test, installation test, and the
    already-skipped external clone test. Mark only the daemon-launching
    cleanup parameter so the other cleanup cases remain selected.
    
    Existing skips and test bodies remain unchanged. Normalize TOML formatting
    and imports in the touched files.
    
    Assisted-by: GPT 6.0 Astra
    Co-authored-by: GPT 6.0 Astra <codex@openai.com>
    Byron and codex committed Nov 4, 2026
    Configuration menu
    Copy the full SHA
    cb10d13 View commit details
    Browse the repository at this point in the history
  3. Merge pull request gitpython-developers#2336 from Keerthana-64/ref-ar…

    …gs-exact-name
    
    fix: read reference arguments by exact name in revision APIs
    Byron authored Nov 4, 2026
    Configuration menu
    Copy the full SHA
    652cb3f View commit details
    Browse the repository at this point in the history
  4. Merge pull request gitpython-developers#2338 from gitpython-developer…

    …s/no-network
    
    no network
    Byron authored Nov 4, 2026
    Configuration menu
    Copy the full SHA
    8e919a4 View commit details
    Browse the repository at this point in the history
  5. fix(util): tolerate deleted temporary environment variables

    When a `patch_env()` body deletes a variable that was initially absent,
    cleanup raises `KeyError` and can mask an exception from the body.
    Use `os.environ.pop(name, None)` to restore absence idempotently while
    preserving restoration of existing values.
    
    Add 18 regression cases for absent, empty and populated original values,
    keep/replace/delete body mutations and normal/exceptional exits.
    The focused CLI-backend tests changed from 2 failed and 16 passed to
    18 passed. Ruff lint/format and `git diff --check` passed. The full suite
    was not run because its required `GixPython` Windows wheel was unavailable.
    
    Agent-Model: unknown
    Abedyn committed Nov 4, 2026
    Configuration menu
    Copy the full SHA
    e52b7f8 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2026

  1. review

    Byron committed Nov 5, 2026
    Configuration menu
    Copy the full SHA
    32b4d8e View commit details
    Browse the repository at this point in the history
  2. Merge pull request gitpython-developers#2340 from Abedyn/fix/patch-en…

    …v-deleted-variable
    
    fix(util): tolerate deleted temporary environment variables
    Byron authored Nov 5, 2026
    Configuration menu
    Copy the full SHA
    f6db6e7 View commit details
    Browse the repository at this point in the history
  3. test(refs): use POSIX paths for Git reference names

    <!-- agent -->
    Restore Windows CI coverage for `PathLike` revision arguments. The test
    introduced in `6de90f1c` uses `Path("refs/heads/main")`, which emits
    backslashes on Windows. Those are invalid Git reference names, so resolving
    `SymbolicReference` fails during ref-name validation in all four
    files/reftable and SHA-1/SHA-256 variants. The same failures were already
    present in PR gitpython-developers#2336, before the unrelated `patch_env()` change in PR gitpython-developers#2340.
    
    Use `PurePosixPath` for the test's Git reference names, which use forward
    slashes on every platform. It still implements `os.PathLike`, preserving
    coverage through `SymbolicReference` and direct and nested `merge_base()`
    arguments alongside `PathLikeMock`. Keep native `Path` for filesystem
    operations elsewhere in the module and preserve production validation.
    
    Assisted-by: GPT 6.1 Sol
    Co-authored-by: GPT 6.1 Sol <codex@openai.com>
    Byron and codex committed Nov 5, 2026
    Configuration menu
    Copy the full SHA
    9bfb816 View commit details
    Browse the repository at this point in the history
  4. test: isolate repository fixtures from checkout history

    Took a quick look, pretty zoomed out, but think it's
    a desirable change as finally the test-suite is independent
    of the input repository or state.
    
    <!-- agent -->
    Make PR and post-merge test results independent of checkout depth, refs,
    and history. The shared test repository and dependency clone sources
    previously came from the source checkout, requiring historical objects
    and a bootstrap script even though setup already used `gix.testtools`.
    
    Generate small repositories from scratch through `gix.testtools`, with
    named root, release, merge, conflict, rename, date, and submodule states.
    Adapt legacy assertions to those scenarios while retaining merge,
    serialization, traversal, index, remote, and nested-submodule coverage.
    Make dirty-submodule removal checks explicit for staged, unstaged, and
    untracked data, including dry runs.
    
    Remove the source-history environment override, dependency factory,
    checkout lock cleanup, and bootstrap script. The main CI suites now use
    shallow checkouts and remove source `.git` metadata before pytest. Add a
    regression that initializes the shared fixture from a source copy without
    Git metadata, and document the isolation requirement. Hash raw parser
    samples in cache arguments to avoid archive filename limits on cold runs.
    
    Assisted-by: GPT 6.0 Astra
    Co-authored-by: GPT 6.0 Astra <codex@openai.com>
    Byron and codex committed Nov 5, 2026
    Configuration menu
    Copy the full SHA
    0901035 View commit details
    Browse the repository at this point in the history
  5. test(gitdb): generate standalone packed and loose object fixtures

    <!-- agent -->
    GitDB tests previously opened the source checkout's `.git` directory or
    `GITDB_TEST_GIT_REPO_BASE`, making their input depend on clone history.
    Give each test class a disposable repository generated by a fixture
    script, with packed history and additional loose objects. Isolate Git
    configuration and identity during setup and register class cleanup.
    
    Run the script with Bash so the standalone suite retains Python 3.8
    support without adding a GixPython dependency. Remove the history override
    and full-depth checkout from dependency CI, remove source `.git` before
    running the suite, and document the new setup.
    Use the actual database size when writing a pack instead of the unrelated
    iteration count, which the smaller fixture exposed.
    
    Assisted-by: GPT 6.0 Astra
    Co-authored-by: GPT 6.0 Astra <codex@openai.com>
    Byron and codex committed Nov 5, 2026
    Configuration menu
    Copy the full SHA
    f7633d8 View commit details
    Browse the repository at this point in the history
  6. fix(benchmarks): address review feedback on workload comparisons and …

    …counts
    
    <!-- agent -->
    Address benchmark review feedback on the generated fixtures. Copilot noted
    that "performance tests still report their iteration limits of 1,000–10,000
    as processed counts" even though the fixture has only 90 packed objects.
    Use the existing streaming counters and clamp list-based limits to the
    available SHA count so both totals and throughput reflect completed work.
    
    Copilot also requested: "Include the benchmark harness sources in the
    fingerprint, and add a harness-only change to the digest regression test."
    Hash the Python sources in `test/performance` alongside `VERSION` and `git`.
    This prevents comparing different timed workloads that return the same
    result. Extend the generated source fixture and document the digest scope.
    
    Assisted-by: GPT 6.0 Astra
    Co-authored-by: GPT 6.0 Astra <codex@openai.com>
    Byron and codex committed Nov 5, 2026
    Configuration menu
    Copy the full SHA
    7e8aa8c View commit details
    Browse the repository at this point in the history
  7. Merge pull request gitpython-developers#2341 from gitpython-developer…

    …s/fix-ci
    
    test: isolate repository fixtures and restore Windows reference coverage
    Byron authored Nov 5, 2026
    Configuration menu
    Copy the full SHA
    34dfb13 View commit details
    Browse the repository at this point in the history
Loading