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: jelmer/dulwich
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dulwich-0.21.7
Choose a base ref
...
head repository: jelmer/dulwich
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 8,839 additions and 5,078 deletions.
  1. +1 −1 .codespellrc
  2. +18 −0 .github/dependabot.yml
  3. +23 −0 .github/gpg-error-config
  4. +29 −0 .github/gpgme-config
  5. +22 −0 .github/workflows/auto-merge.yml
  6. +4 −3 .github/workflows/disperse.yml
  7. +3 −2 .github/workflows/docs.yml
  8. +115 −30 .github/workflows/python-distributions.yml
  9. +20 −7 .github/workflows/pythontest.yml
  10. +3 −0 .gitignore
  11. +1 −1 .stestr.conf
  12. +1 −1 .testr.conf
  13. +1 −1 CODE_OF_CONDUCT.md
  14. +2 −3 CONTRIBUTING.rst
  15. +2 −0 COPYING
  16. +193 −0 Cargo.lock
  17. +9 −0 Cargo.toml
  18. +5 −1 MANIFEST.in
  19. +7 −18 Makefile
  20. +114 −1 NEWS
  21. +20 −4 README.rst
  22. +1 −0 bin/dul-receive-pack
  23. +1 −0 bin/dul-upload-pack
  24. +1 −0 bin/dulwich
  25. +10 −0 crates/diff-tree/Cargo.toml
  26. +198 −0 crates/diff-tree/src/lib.rs
  27. +11 −0 crates/objects/Cargo.toml
  28. +157 −0 crates/objects/src/lib.rs
  29. +11 −0 crates/pack/Cargo.toml
  30. +226 −0 crates/pack/src/lib.rs
  31. +1 −0 devscripts/PREAMBLE.py
  32. +2 −0 devscripts/replace-preamble.sh
  33. +0 −12 disperse.conf
  34. +17 −0 disperse.toml
  35. +0 −1 docs/index.txt
  36. +0 −11 docs/performance.txt
  37. +2 −1 dulwich/__init__.py
  38. +0 −470 dulwich/_diff_tree.c
  39. +0 −309 dulwich/_objects.c
  40. +0 −282 dulwich/_pack.c
  41. +2 −1 dulwich/archive.py
  42. +9 −7 dulwich/bundle.py
  43. +151 −106 dulwich/cli.py
  44. +719 −174 dulwich/client.py
  45. +3 −2 dulwich/cloud/gcs.py
  46. +30 −35 dulwich/config.py
  47. +2 −2 dulwich/contrib/README.swift.rst
  48. +1 −12 dulwich/contrib/__init__.py
  49. +5 −4 dulwich/contrib/diffstat.py
  50. +6 −1 dulwich/contrib/paramiko_vendor.py
  51. +1 −0 dulwich/contrib/release_robot.py
  52. +3 −3 dulwich/contrib/requests_vendor.py
  53. +52 −46 dulwich/contrib/swift.py
  54. +4 −1 dulwich/credentials.py
  55. +42 −28 dulwich/diff_tree.py
  56. +5 −5 dulwich/errors.py
  57. +14 −14 dulwich/fastexport.py
  58. +9 −8 dulwich/file.py
  59. +12 −8 dulwich/graph.py
  60. +9 −8 dulwich/greenthreads.py
  61. +3 −6 dulwich/hooks.py
  62. +9 −12 dulwich/ignore.py
  63. +97 −54 dulwich/index.py
  64. +1 −0 dulwich/lfs.py
  65. +1 −0 dulwich/line_ending.py
  66. +4 −3 dulwich/log_utils.py
  67. +12 −15 dulwich/lru_cache.py
  68. +4 −3 dulwich/mailmap.py
  69. +128 −90 dulwich/object_store.py
  70. +148 −121 dulwich/objects.py
  71. +13 −11 dulwich/objectspec.py
  72. +126 −125 dulwich/pack.py
  73. +15 −12 dulwich/patch.py
  74. +282 −92 dulwich/porcelain.py
  75. +51 −11 dulwich/protocol.py
  76. +3 −2 dulwich/reflog.py
  77. +63 −55 dulwich/refs.py
  78. +128 −59 dulwich/repo.py
  79. +84 −82 dulwich/server.py
  80. +342 −0 dulwich/sparse_patterns.py
  81. +2 −2 dulwich/stash.py
  82. +3 −2 dulwich/submodule.py
  83. +2 −215 dulwich/tests/__init__.py
  84. +56 −522 dulwich/tests/test_object_store.py
  85. +14 −15 dulwich/tests/utils.py
  86. +19 −18 dulwich/walk.py
  87. +29 −25 dulwich/web.py
  88. +2 −1 examples/clone.py
  89. +2 −0 examples/config.py
  90. +2 −0 examples/diff.py
  91. +1 −0 examples/gcs.py
  92. +4 −4 examples/latest_change.py
  93. +2 −0 examples/memoryrepo.py
  94. +1 −0 examples/rename-branch.py
  95. +190 −0 fuzzing/README.md
  96. +5 −0 fuzzing/dictionaries/fuzz_bundle.dict
  97. +52 −0 fuzzing/dictionaries/fuzz_configfile.dict
  98. +12 −0 fuzzing/dictionaries/fuzz_object_store.dict
  99. +5 −0 fuzzing/dictionaries/fuzz_repo.dict
  100. +57 −0 fuzzing/fuzz-targets/fuzz_bundle.py
  101. +39 −0 fuzzing/fuzz-targets/fuzz_configfile.py
  102. +97 −0 fuzzing/fuzz-targets/fuzz_object_store.py
  103. +66 −0 fuzzing/fuzz-targets/fuzz_repo.py
  104. +92 −0 fuzzing/fuzz-targets/test_utils.py
  105. +18 −0 fuzzing/oss-fuzz-scripts/build.sh
  106. +86 −0 fuzzing/oss-fuzz-scripts/container-environment-bootstrap.sh
  107. +25 −0 limmat.toml
  108. +30 −12 pyproject.toml
  109. +38 −12 setup.py
  110. BIN testdata/indexes/index_skip_hash
  111. +236 −0 tests/__init__.py
  112. +2 −1 {dulwich → }/tests/compat/__init__.py
  113. +24 −22 {dulwich → }/tests/compat/server_utils.py
  114. +135 −46 {dulwich → }/tests/compat/test_client.py
  115. +13 −12 {dulwich → }/tests/compat/test_pack.py
  116. +5 −3 {dulwich → }/tests/compat/test_patch.py
  117. +82 −10 {dulwich → }/tests/compat/test_porcelain.py
  118. +21 −20 {dulwich → }/tests/compat/test_repository.py
  119. +7 −6 {dulwich → }/tests/compat/test_server.py
  120. +13 −12 {dulwich → }/tests/compat/test_utils.py
  121. +21 −20 {dulwich → }/tests/compat/test_web.py
  122. +16 −20 {dulwich → }/tests/compat/utils.py
  123. +33 −0 tests/contrib/__init__.py
  124. +12 −10 {dulwich → tests}/contrib/test_paramiko_vendor.py
  125. +10 −10 {dulwich → tests}/contrib/test_release_robot.py
  126. +40 −39 {dulwich → tests}/contrib/test_swift.py
  127. +21 −22 {dulwich → tests}/contrib/test_swift_smoke.py
  128. +13 −12 {dulwich → }/tests/test_archive.py
  129. +8 −7 {dulwich → }/tests/test_blackbox.py
  130. +5 −4 {dulwich → }/tests/test_bundle.py
  131. +266 −187 {dulwich → }/tests/test_client.py
  132. +73 −72 {dulwich → }/tests/test_config.py
  133. +11 −6 {dulwich → }/tests/test_credentials.py
  134. +80 −77 {dulwich → }/tests/test_diff_tree.py
  135. +23 −22 {dulwich → }/tests/test_fastexport.py
  136. +21 −20 {dulwich → }/tests/test_file.py
  137. +25 −24 {dulwich → }/tests/test_grafts.py
  138. +21 −20 {dulwich → }/tests/test_graph.py
  139. +8 −7 {dulwich → }/tests/test_greenthreads.py
  140. +7 −6 {dulwich → }/tests/test_hooks.py
  141. +20 −19 {dulwich → }/tests/test_ignore.py
  142. +71 −57 {dulwich → }/tests/test_index.py
  143. +6 −4 {dulwich → }/tests/test_lfs.py
  144. +23 −22 {dulwich → }/tests/test_line_ending.py
  145. +37 −35 {dulwich → }/tests/test_lru_cache.py
  146. +4 −3 {dulwich → }/tests/test_mailmap.py
  147. +26 −25 {dulwich → }/tests/test_missing_obj_finder.py
  148. +547 −0 tests/test_object_store.py
  149. +234 −149 {dulwich → }/tests/test_objects.py
  150. +39 −39 {dulwich → }/tests/test_objectspec.py
  151. +170 −127 {dulwich → }/tests/test_pack.py
  152. +33 −34 {dulwich → }/tests/test_patch.py
  153. +712 −189 {dulwich → }/tests/test_porcelain.py
  154. +69 −41 {dulwich → }/tests/test_protocol.py
  155. +11 −10 {dulwich → }/tests/test_reflog.py
  156. +103 −73 {dulwich → }/tests/test_refs.py
  157. +127 −113 {dulwich → }/tests/test_repository.py
  158. +93 −93 {dulwich → }/tests/test_server.py
  159. +359 −0 tests/test_sparse_patterns.py
  160. +5 −3 {dulwich → }/tests/test_stash.py
  161. +12 −11 {dulwich → }/tests/test_utils.py
  162. +46 −45 {dulwich → }/tests/test_walk.py
  163. +65 −64 {dulwich → }/tests/test_web.py
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[codespell]
skip = .git,.mypy_cache,build,testdata
ignore-words-list = fpr,claus,feld,nd,bu,ue,te,fo,afile,manuel
ignore-words-list = fpr,claus,feld,nd,bu,ue,te,fo,afile,manuel,checkin,assertIn,rin
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Keep GitHub Actions up to date with GitHub's Dependabot...
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
rebase-strategy: "disabled"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: weekly
23 changes: 23 additions & 0 deletions .github/gpg-error-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

# gpg-error-config: simple replacement gpg-error-config that is a shim
# for pkg-config.

# Parse flags
for arg in "$@"; do
case $arg in
--cflags)
pkg-config --cflags gpg-error
;;
--libs)
pkg-config --libs gpg-error
;;
--version)
pkg-config --modversion gpg-error
;;
*)
echo "Unknown option: $arg" >&2
exit 1
;;
esac
done
29 changes: 29 additions & 0 deletions .github/gpgme-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# Parse gpgme-config-like flags, then invoke `pkg-config gpgme`:
# * Pass --cflags and --libs through
# * Map --version to --modversion
# * Ignore --thread=pthread

# Parse flags
for arg in "$@"; do
case "$arg" in
--cflags|--libs|--modversion)
flags="$flags $arg"
;;
--version)
flags="$flags --modversion"
;;
--thread=pthread)
;;
--prefix)
flags="$flags --variable=prefix"
;;
*)
echo "Unknown flag: $arg" >&2
exit 1
;;
esac
done

exec pkg-config gpgme $flags
22 changes: 22 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dependabot auto-merge
on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
7 changes: 4 additions & 3 deletions .github/workflows/disperse.yml
Original file line number Diff line number Diff line change
@@ -2,13 +2,14 @@
name: Disperse configuration

"on":
- push
push:
branches: [ main, master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: jelmer/action-disperse-validate@v1
- uses: actions/checkout@v4
- uses: jelmer/action-disperse-validate@v2
5 changes: 3 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ name: API Docs

on:
push:
branches: [ main, master ]
pull_request:
schedule:
- cron: "0 6 * * *" # Daily 6AM UTC build
@@ -12,9 +13,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install pydoctor
145 changes: 115 additions & 30 deletions .github/workflows/python-distributions.yml
Original file line number Diff line number Diff line change
@@ -2,79 +2,164 @@ name: Build Python distributions

on:
push:
branches: [ main, master ]
tags:
- 'dulwich-*'
pull_request:
schedule:
- cron: "0 6 * * *" # Daily 6AM UTC build

jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.merged-identifiers.outputs.merged-identifiers }}

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Install cibuildwheel
run: pip install cibuildwheel
- name: Find build identifiers using cibuildwheel --print-build-identifiers
id: all-build-identifiers
run: |
echo "linux=$(cibuildwheel --platform linux --print-build-identifiers | tr '\n' ' ')" >> $GITHUB_OUTPUT
echo "macos=$(cibuildwheel --platform macos --print-build-identifiers | tr '\n' ' ')" >> $GITHUB_OUTPUT
echo "windows=$(cibuildwheel --platform windows --print-build-identifiers | tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Select build identifiers
id: select-build-identifiers
run: |
if [[ "$GITHUB_REF" = "refs/heads/main" ]] || [[ "$GITHUB_REF" = "refs/heads/master" ]] || [[ "$GITHUB_REF" = "refs/tags/"* ]]; then
echo 'linux=${{ steps.all-build-identifiers.outputs.linux }}' >> $GITHUB_OUTPUT
echo 'windows=${{ steps.all-build-identifiers.outputs.windows }}' >> $GITHUB_OUTPUT
echo 'macos=${{ steps.all-build-identifiers.outputs.macos }}' >> $GITHUB_OUTPUT
else
echo "linux=$(echo -n '${{ steps.all-build-identifiers.outputs.linux }}' | awk '{print $NF}')" >> $GITHUB_OUTPUT
echo "macos=$(echo -n '${{ steps.all-build-identifiers.outputs.macos }}' | awk '{print $NF}')" >> $GITHUB_OUTPUT
echo "windows=$(echo -n '${{ steps.all-build-identifiers.outputs.windows }}' | awk '{print $NF}')" >> $GITHUB_OUTPUT
fi
- name: Output build identifiers
id: json-identifiers
run: |
echo "linux=$(echo -n '${{ steps.select-build-identifiers.outputs.linux }}' | jq -R -s -c 'split(" ") | map(select(length > 0)) | [.[] | {os: "ubuntu-latest", "build-identifier": .}]')" >> $GITHUB_OUTPUT
echo "macos=$(echo -n '${{ steps.select-build-identifiers.outputs.macos }}' | jq -R -s -c 'split(" ") | map(select(length > 0)) | [.[] | {os: "macos-latest", "build-identifier": .}]')" >> $GITHUB_OUTPUT
echo "windows=$(echo -n '${{ steps.select-build-identifiers.outputs.windows }}' | jq -R -s -c 'split(" ") | map(select(length > 0)) | [.[] | {os: "windows-latest", "build-identifier": .}]')" >> $GITHUB_OUTPUT
- name: Merge build identifiers
id: merged-identifiers
run: |
echo merged-identifiers=$(echo -n '${{ steps.json-identifiers.outputs.linux }} ${{ steps.json-identifiers.outputs.macos }} ${{ steps.json-identifiers.outputs.windows }}' | jq -c -s 'add') >> $GITHUB_OUTPUT
build-wheels:
runs-on: ${{ matrix.os }}
needs: define-matrix
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include: ${{ fromJSON(needs.define-matrix.outputs.matrix ) }}
fail-fast: true

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install native dependencies (Ubuntu)
run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev
if: "matrix.os == 'ubuntu-latest'"
- name: Install native dependencies (MacOS)
run: brew install swig gpgme
if: "matrix.os == 'macos-latest'"
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel fastimport paramiko urllib3 cibuildwheel==2.16.2
- name: Install gpg on supported platforms
run: pip install -U gpg
if: "matrix.os != 'windows-latest'"
- name: Run test suite
run: python -m unittest dulwich.tests.test_suite
pip install setuptools wheel cibuildwheel setuptools-rust
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
if: "matrix.os == 'ubuntu-latest'"
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
CIBW_ARCHS_WINDOWS: AMD64 x86
CIBW_BUILD: "${{ matrix.build-identifier }}*"
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.build-identifier }}
path: ./wheelhouse/*.whl

build-pure-wheels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: pip
- run: pip install build
- run: PURE=true python -m build --wheel
- name: Upload pure wheels
uses: actions/upload-artifact@v4
with:
name: artifact-pure
path: ./dist/*.whl

build-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build sdist
run: python -m build --sdist
- name: Upload sdist
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-source
path: ./dist/*.tar.gz

test-sdist:
needs:
- build-sdist
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Upgrade packging to avoid a bug in twine.
# See https://github.com/pypa/twine/issues/1216
pip install "twine>=6.1.0" "packaging>=24.2"
- name: Download sdist
uses: actions/download-artifact@v4
with:
name: artifact-source
path: dist
- name: Test sdist
run: twine check dist/*
- name: Test installation from sdist
run: pip install dist/*.tar.gz

publish:
runs-on: ubuntu-latest
needs:
- build-wheels
- build-sdist
- build-pure-wheels
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/dulwich-')
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/dulwich
steps:
- name: Download distributions
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: artifact
merge-multiple: true
pattern: artifact-*
path: dist
- name: Publish distributions
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading