From 49c3178711ddb3510f0e96297187f823cc019871 Mon Sep 17 00:00:00 2001
From: Sebastian Thiel <sebastian.thiel@icloud.com>
Date: Thu, 24 Nov 2022 06:24:37 +0100
Subject: [PATCH 01/18] use python3 binary

MacOS Ventura doesn't come with a `python` binary anymore
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index a7acbb1..7aa5a71 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-PYTHON = python
+PYTHON = python3
 SETUP = $(PYTHON) setup.py
 TESTFLAGS =
 

From b6faecc46fcc4f6412149f2021447c0070eba60e Mon Sep 17 00:00:00 2001
From: Ondrej Tethal <ondrej.tethal@oracle.com>
Date: Fri, 9 Dec 2022 10:21:58 +0100
Subject: [PATCH 02/18] Use ZLIB_RUNTIME_VERSION if available

---
 gitdb/stream.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gitdb/stream.py b/gitdb/stream.py
index 222b843..1b5426f 100644
--- a/gitdb/stream.py
+++ b/gitdb/stream.py
@@ -294,7 +294,7 @@ def read(self, size=-1):
         # However, the zlib VERSIONs as well as the platform check is used to further match the entries in the 
         # table in the github issue. This is it ... it was the only way I could make this work everywhere.
         # IT's CERTAINLY GOING TO BITE US IN THE FUTURE ... .
-        if zlib.ZLIB_VERSION in ('1.2.7', '1.2.5') and not sys.platform == 'darwin':
+        if getattr(zlib, 'ZLIB_RUNTIME_VERSION', zlib.ZLIB_VERSION) in ('1.2.7', '1.2.5') and not sys.platform == 'darwin':
             unused_datalen = len(self._zip.unconsumed_tail)
         else:
             unused_datalen = len(self._zip.unconsumed_tail) + len(self._zip.unused_data)

From 32d12aa03aff193603aad1d6f08669a70607beb9 Mon Sep 17 00:00:00 2001
From: Hugo van Kemenade <hugovk@users.noreply.github.com>
Date: Sun, 10 Sep 2023 18:38:38 +0300
Subject: [PATCH 03/18] Bump GitHub Actions

---
 .github/workflows/pythonpackage.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml
index 0d039ad..1cefabc 100644
--- a/.github/workflows/pythonpackage.yml
+++ b/.github/workflows/pythonpackage.yml
@@ -18,7 +18,7 @@ jobs:
         python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
 
     steps:
-    - uses: actions/checkout@v3
+    - uses: actions/checkout@v4
       with:
         fetch-depth: 1000
     - name: Set up Python ${{ matrix.python-version }}

From d7fc1fd3d154c809b1c021ae3fa564e9fe4b4859 Mon Sep 17 00:00:00 2001
From: Hugo van Kemenade <hugovk@users.noreply.github.com>
Date: Sun, 10 Sep 2023 18:38:56 +0300
Subject: [PATCH 04/18] Add support for Python 3.12

---
 .github/workflows/pythonpackage.yml | 3 ++-
 setup.py                            | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml
index 1cefabc..dab41d0 100644
--- a/.github/workflows/pythonpackage.yml
+++ b/.github/workflows/pythonpackage.yml
@@ -15,7 +15,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
+        python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
 
     steps:
     - uses: actions/checkout@v4
@@ -25,6 +25,7 @@ jobs:
       uses: actions/setup-python@v4
       with:
         python-version: ${{ matrix.python-version }}
+        allow-prereleases: true
     - name: Install dependencies
       run: |
         python -m pip install --upgrade pip
diff --git a/setup.py b/setup.py
index 5214849..61b5727 100755
--- a/setup.py
+++ b/setup.py
@@ -40,6 +40,7 @@
         "Programming Language :: Python :: 3.9",
         "Programming Language :: Python :: 3.10",
         "Programming Language :: Python :: 3.11",
+        "Programming Language :: Python :: 3.12",
         "Programming Language :: Python :: 3 :: Only",
     ]
 )

From 875acb45cd8e9353c1911717bd2cd05b3e40ed05 Mon Sep 17 00:00:00 2001
From: Hugo van Kemenade <hugovk@users.noreply.github.com>
Date: Sun, 10 Sep 2023 18:39:33 +0300
Subject: [PATCH 05/18] Drop support for EOL Python 3.7

---
 .github/workflows/pythonpackage.yml | 2 +-
 setup.py                            | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml
index dab41d0..98e670c 100644
--- a/.github/workflows/pythonpackage.yml
+++ b/.github/workflows/pythonpackage.yml
@@ -15,7 +15,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
+        python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
 
     steps:
     - uses: actions/checkout@v4
diff --git a/setup.py b/setup.py
index 61b5727..5734122 100755
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@
     zip_safe=False,
     install_requires=['smmap>=3.0.1,<6'],
     long_description="""GitDB is a pure-Python git object database""",
-    python_requires='>=3.7',
+    python_requires='>=3.8',
     # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
     classifiers=[
         "Development Status :: 5 - Production/Stable",
@@ -35,7 +35,6 @@
         "Operating System :: MacOS :: MacOS X",
         "Programming Language :: Python",
         "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
         "Programming Language :: Python :: 3.10",

From 8ac188497e7ac1ef2e89c984ac3728319b625e1a Mon Sep 17 00:00:00 2001
From: Eliah Kagan <degeneracypressure@gmail.com>
Date: Sun, 10 Sep 2023 18:14:06 -0400
Subject: [PATCH 06/18] Enable Dependabot version updates for Actions

This enables Dependabot version updates for GitHub Actions only
(not Python dependencies), using the exact same configuration as in
GitPython.
---
 .github/dependabot.yml | 6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 .github/dependabot.yml

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..203f3c8
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,6 @@
+version: 2
+updates:
+- package-ecosystem: "github-actions"
+  directory: "/"
+  schedule:
+      interval: "weekly"

From e7937aefaf49c72b5f4432cc1f303ed23889589a Mon Sep 17 00:00:00 2001
From: Eliah Kagan <degeneracypressure@gmail.com>
Date: Mon, 11 Sep 2023 02:31:34 -0400
Subject: [PATCH 07/18] Test installing project on CI

This changes the CI workflow to install the project itself to get
its dependency, rather than installing the dependency from
requirements.txt. This is the more important thing to test, because
it verifies that the project is installable and effectively
declares the dependencies it needs.
---
 .github/workflows/pythonpackage.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml
index 98e670c..efa04a9 100644
--- a/.github/workflows/pythonpackage.yml
+++ b/.github/workflows/pythonpackage.yml
@@ -26,10 +26,10 @@ jobs:
       with:
         python-version: ${{ matrix.python-version }}
         allow-prereleases: true
-    - name: Install dependencies
+    - name: Install project and dependencies
       run: |
         python -m pip install --upgrade pip
-        pip install -r requirements.txt
+        pip install .
     - name: Lint with flake8
       run: |
         pip install flake8

From 60f7f94607996e05292896e8105ef3780779959d Mon Sep 17 00:00:00 2001
From: Eliah Kagan <degeneracypressure@gmail.com>
Date: Mon, 11 Sep 2023 03:38:59 -0400
Subject: [PATCH 08/18] Fix mkdir race condition in LooseObjectDB.store

This replaces the conditional call to os.mkdir that raises an
unintended FileExistsError if the directory is created between the
check and the os.mkdir call, using a single os.makedirs call
instead, with exist_ok=True.

This way, we attempt creation in a way that produces no error if
the directory is already present, while still raising
FileExistsError if a non-directory filesystem entry (such as a
regular file) is present where we want the directory to be.
---
 gitdb/db/loose.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/gitdb/db/loose.py b/gitdb/db/loose.py
index 4ef7750..7ea6fef 100644
--- a/gitdb/db/loose.py
+++ b/gitdb/db/loose.py
@@ -8,7 +8,6 @@
     ObjectDBW
 )
 
-
 from gitdb.exc import (
     BadObject,
     AmbiguousObjectName
@@ -33,10 +32,8 @@
     bin_to_hex,
     exists,
     chmod,
-    isdir,
     isfile,
     remove,
-    mkdir,
     rename,
     dirname,
     basename,
@@ -222,8 +219,7 @@ def store(self, istream):
         if tmp_path:
             obj_path = self.db_path(self.object_path(hexsha))
             obj_dir = dirname(obj_path)
-            if not isdir(obj_dir):
-                mkdir(obj_dir)
+            os.makedirs(obj_dir, exist_ok=True)
             # END handle destination directory
             # rename onto existing doesn't work on NTFS
             if isfile(obj_path):

From 9d126ce78e69fb8aba28ae89adde69298a3066a4 Mon Sep 17 00:00:00 2001
From: Eliah Kagan <degeneracypressure@gmail.com>
Date: Mon, 11 Sep 2023 04:33:18 -0400
Subject: [PATCH 09/18] Don't cancel other jobs from the 3.12 job failing

Because 3.12 is still a release candidate and if tests fail for it
then one would always want to know if/how other versions also fail.

This also allows actions/setup-python to install a prerelease for
3.12 only, not for other releases.
---
 .github/workflows/pythonpackage.yml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml
index efa04a9..c59e618 100644
--- a/.github/workflows/pythonpackage.yml
+++ b/.github/workflows/pythonpackage.yml
@@ -16,6 +16,11 @@ jobs:
     strategy:
       matrix:
         python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
+        include:
+          - experimental: false
+          - python-version: "3.12"
+            experimental: true
+    continue-on-error: ${{ matrix.experimental }}
 
     steps:
     - uses: actions/checkout@v4
@@ -25,7 +30,7 @@ jobs:
       uses: actions/setup-python@v4
       with:
         python-version: ${{ matrix.python-version }}
-        allow-prereleases: true
+        allow-prereleases: ${{ matrix.experimental }}
     - name: Install project and dependencies
       run: |
         python -m pip install --upgrade pip

From 919d3cce57d0a3c398dc4ddbacbbd23942a6ff4c Mon Sep 17 00:00:00 2001
From: Eliah Kagan <degeneracypressure@gmail.com>
Date: Mon, 11 Sep 2023 04:17:52 -0400
Subject: [PATCH 10/18] Use actions/checkout feature to fetch all commits

Setting the "fetch-depth" to a positive value fetches that many
commits back (and the default value is 1), but setting it to 0
fetches all commits, as in a (deep) normal fetch.
---
 .github/workflows/pythonpackage.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml
index efa04a9..14c7ecb 100644
--- a/.github/workflows/pythonpackage.yml
+++ b/.github/workflows/pythonpackage.yml
@@ -20,7 +20,7 @@ jobs:
     steps:
     - uses: actions/checkout@v4
       with:
-        fetch-depth: 1000
+        fetch-depth: 0
     - name: Set up Python ${{ matrix.python-version }}
       uses: actions/setup-python@v4
       with:

From bd21ed46addf55fea5059d44e0477a785f4a664f Mon Sep 17 00:00:00 2001
From: Eliah Kagan <degeneracypressure@gmail.com>
Date: Mon, 11 Sep 2023 05:18:27 -0400
Subject: [PATCH 11/18] Revert "Drop support for EOL Python 3.7"

This brings back Python 3.7 support (allowing it to be installed on
3.7, and testing on 3.7 on CI), even though 3.7 is end-of-life,
because support for 3.7 is not being dropped by GitPython yet, and
there is value in keeping the version ranges supported by GitPython
and gitdb consistent.

This reverts commit 875acb45cd8e9353c1911717bd2cd05b3e40ed05.
---
 .github/workflows/pythonpackage.yml | 2 +-
 setup.py                            | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml
index 3d06b4a..6849763 100644
--- a/.github/workflows/pythonpackage.yml
+++ b/.github/workflows/pythonpackage.yml
@@ -15,7 +15,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
+        python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
         include:
           - experimental: false
           - python-version: "3.12"
diff --git a/setup.py b/setup.py
index 5734122..61b5727 100755
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@
     zip_safe=False,
     install_requires=['smmap>=3.0.1,<6'],
     long_description="""GitDB is a pure-Python git object database""",
-    python_requires='>=3.8',
+    python_requires='>=3.7',
     # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
     classifiers=[
         "Development Status :: 5 - Production/Stable",
@@ -35,6 +35,7 @@
         "Operating System :: MacOS :: MacOS X",
         "Programming Language :: Python",
         "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
         "Programming Language :: Python :: 3.10",

From e0769d1ed2d9044d7523c2eb2f8a0d44a90deb9e Mon Sep 17 00:00:00 2001
From: Eliah Kagan <degeneracypressure@gmail.com>
Date: Sun, 17 Sep 2023 08:36:34 -0400
Subject: [PATCH 12/18] Fix top-of-file license URLs here in gitdb too

This is the gitdb part of the fix for the top-of-file license URLs
that have come to point to a page about a related but different
license from the one GitPython and gitdb are (intended to be)
offered under.

See https://github.com/gitpython-developers/GitPython/pull/1662
for details about the problem and how it came about.
---
 gitdb/__init__.py                             |  2 +-
 gitdb/base.py                                 |  2 +-
 gitdb/db/__init__.py                          |  2 +-
 gitdb/db/base.py                              |  2 +-
 gitdb/db/git.py                               |  2 +-
 gitdb/db/loose.py                             |  2 +-
 gitdb/db/mem.py                               |  2 +-
 gitdb/db/pack.py                              |  2 +-
 gitdb/db/ref.py                               |  2 +-
 gitdb/exc.py                                  |  2 +-
 gitdb/fun.py                                  |  2 +-
 gitdb/pack.py                                 |  6 +++---
 gitdb/stream.py                               | 10 +++++-----
 gitdb/test/__init__.py                        |  2 +-
 gitdb/test/db/__init__.py                     |  2 +-
 gitdb/test/db/lib.py                          |  2 +-
 gitdb/test/db/test_git.py                     |  2 +-
 gitdb/test/db/test_loose.py                   |  2 +-
 gitdb/test/db/test_mem.py                     |  2 +-
 gitdb/test/db/test_pack.py                    |  2 +-
 gitdb/test/db/test_ref.py                     |  2 +-
 gitdb/test/lib.py                             |  2 +-
 gitdb/test/performance/lib.py                 |  2 +-
 gitdb/test/performance/test_pack.py           |  2 +-
 gitdb/test/performance/test_pack_streaming.py |  2 +-
 gitdb/test/performance/test_stream.py         |  2 +-
 gitdb/test/test_base.py                       |  2 +-
 gitdb/test/test_example.py                    |  2 +-
 gitdb/test/test_pack.py                       |  4 ++--
 gitdb/test/test_stream.py                     |  2 +-
 gitdb/test/test_util.py                       |  2 +-
 gitdb/typ.py                                  |  2 +-
 gitdb/util.py                                 |  2 +-
 33 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/gitdb/__init__.py b/gitdb/__init__.py
index b777632..2fb3f7e 100644
--- a/gitdb/__init__.py
+++ b/gitdb/__init__.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Initialize the object database module"""
 
 import sys
diff --git a/gitdb/base.py b/gitdb/base.py
index 42e71d0..9a23a4f 100644
--- a/gitdb/base.py
+++ b/gitdb/base.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Module with basic data structures - they are designed to be lightweight and fast"""
 from gitdb.util import bin_to_hex
 
diff --git a/gitdb/db/__init__.py b/gitdb/db/__init__.py
index 0a2a46a..20fd228 100644
--- a/gitdb/db/__init__.py
+++ b/gitdb/db/__init__.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 
 from gitdb.db.base import *
 from gitdb.db.loose import *
diff --git a/gitdb/db/base.py b/gitdb/db/base.py
index e89052e..7312fe0 100644
--- a/gitdb/db/base.py
+++ b/gitdb/db/base.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Contains implementations of database retrieveing objects"""
 from gitdb.util import (
     join,
diff --git a/gitdb/db/git.py b/gitdb/db/git.py
index e2cb468..a1ed142 100644
--- a/gitdb/db/git.py
+++ b/gitdb/db/git.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 from gitdb.db.base import (
     CompoundDB,
     ObjectDBW,
diff --git a/gitdb/db/loose.py b/gitdb/db/loose.py
index 7ea6fef..256fec9 100644
--- a/gitdb/db/loose.py
+++ b/gitdb/db/loose.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 from gitdb.db.base import (
     FileDBBase,
     ObjectDBR,
diff --git a/gitdb/db/mem.py b/gitdb/db/mem.py
index 1b954cb..d4772fd 100644
--- a/gitdb/db/mem.py
+++ b/gitdb/db/mem.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Contains the MemoryDatabase implementation"""
 from gitdb.db.loose import LooseObjectDB
 from gitdb.db.base import (
diff --git a/gitdb/db/pack.py b/gitdb/db/pack.py
index 1ce786b..274ea59 100644
--- a/gitdb/db/pack.py
+++ b/gitdb/db/pack.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Module containing a database to deal with packs"""
 from gitdb.db.base import (
     FileDBBase,
diff --git a/gitdb/db/ref.py b/gitdb/db/ref.py
index 6bb2a64..bd30156 100644
--- a/gitdb/db/ref.py
+++ b/gitdb/db/ref.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 import codecs
 from gitdb.db.base import (
     CompoundDB,
diff --git a/gitdb/exc.py b/gitdb/exc.py
index 947e5d8..7397037 100644
--- a/gitdb/exc.py
+++ b/gitdb/exc.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Module with common exceptions"""
 from gitdb.util import to_hex_sha
 
diff --git a/gitdb/fun.py b/gitdb/fun.py
index a4454de..a272e5c 100644
--- a/gitdb/fun.py
+++ b/gitdb/fun.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Contains basic c-functions which usually contain performance critical code
 Keeping this code separate from the beginning makes it easier to out-source
 it into c later, if required"""
diff --git a/gitdb/pack.py b/gitdb/pack.py
index cabce4c..e559e11 100644
--- a/gitdb/pack.py
+++ b/gitdb/pack.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Contains PackIndexFile and PackFile implementations"""
 import zlib
 
@@ -263,7 +263,7 @@ def __init__(self, indexpath):
     def close(self):
         mman.force_map_handle_removal_win(self._indexpath)
         self._cursor = None
-        
+
     def _set_cache_(self, attr):
         if attr == "_packfile_checksum":
             self._packfile_checksum = self._cursor.map()[-40:-20]
@@ -528,7 +528,7 @@ def __init__(self, packpath):
     def close(self):
         mman.force_map_handle_removal_win(self._packpath)
         self._cursor = None
-        
+
     def _set_cache_(self, attr):
         # we fill the whole cache, whichever attribute gets queried first
         self._cursor = mman.make_cursor(self._packpath).use_region()
diff --git a/gitdb/stream.py b/gitdb/stream.py
index 1b5426f..1e0be84 100644
--- a/gitdb/stream.py
+++ b/gitdb/stream.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 
 from io import BytesIO
 
@@ -140,7 +140,7 @@ def data(self):
     def close(self):
         """Close our underlying stream of compressed bytes if this was allowed during initialization
         :return: True if we closed the underlying stream
-        :note: can be called safely 
+        :note: can be called safely
         """
         if self._close:
             if hasattr(self._m, 'close'):
@@ -287,11 +287,11 @@ def read(self, size=-1):
         # if we hit the end of the stream
         # NOTE: Behavior changed in PY2.7 onward, which requires special handling to make the tests work properly.
         # They are thorough, and I assume it is truly working.
-        # Why is this logic as convoluted as it is ? Please look at the table in 
+        # Why is this logic as convoluted as it is ? Please look at the table in
         # https://github.com/gitpython-developers/gitdb/issues/19 to learn about the test-results.
         # Basically, on py2.6, you want to use branch 1, whereas on all other python version, the second branch
-        # will be the one that works. 
-        # However, the zlib VERSIONs as well as the platform check is used to further match the entries in the 
+        # will be the one that works.
+        # However, the zlib VERSIONs as well as the platform check is used to further match the entries in the
         # table in the github issue. This is it ... it was the only way I could make this work everywhere.
         # IT's CERTAINLY GOING TO BITE US IN THE FUTURE ... .
         if getattr(zlib, 'ZLIB_RUNTIME_VERSION', zlib.ZLIB_VERSION) in ('1.2.7', '1.2.5') and not sys.platform == 'darwin':
diff --git a/gitdb/test/__init__.py b/gitdb/test/__init__.py
index 8a681e4..03bd406 100644
--- a/gitdb/test/__init__.py
+++ b/gitdb/test/__init__.py
@@ -1,4 +1,4 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
diff --git a/gitdb/test/db/__init__.py b/gitdb/test/db/__init__.py
index 8a681e4..03bd406 100644
--- a/gitdb/test/db/__init__.py
+++ b/gitdb/test/db/__init__.py
@@ -1,4 +1,4 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
diff --git a/gitdb/test/db/lib.py b/gitdb/test/db/lib.py
index b38f1d5..408dd8c 100644
--- a/gitdb/test/db/lib.py
+++ b/gitdb/test/db/lib.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Base classes for object db testing"""
 from gitdb.test.lib import (
     with_rw_directory,
diff --git a/gitdb/test/db/test_git.py b/gitdb/test/db/test_git.py
index 6ecf7d7..73ac1a0 100644
--- a/gitdb/test/db/test_git.py
+++ b/gitdb/test/db/test_git.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 import os
 from gitdb.test.db.lib import (
     TestDBBase,
diff --git a/gitdb/test/db/test_loose.py b/gitdb/test/db/test_loose.py
index 8cc660b..295e2ee 100644
--- a/gitdb/test/db/test_loose.py
+++ b/gitdb/test/db/test_loose.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 from gitdb.test.db.lib import (
     TestDBBase,
     with_rw_directory
diff --git a/gitdb/test/db/test_mem.py b/gitdb/test/db/test_mem.py
index eb563c0..882e54f 100644
--- a/gitdb/test/db/test_mem.py
+++ b/gitdb/test/db/test_mem.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 from gitdb.test.db.lib import (
     TestDBBase,
     with_rw_directory
diff --git a/gitdb/test/db/test_pack.py b/gitdb/test/db/test_pack.py
index 4539f42..bd07906 100644
--- a/gitdb/test/db/test_pack.py
+++ b/gitdb/test/db/test_pack.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 from gitdb.test.db.lib import (
     TestDBBase,
     with_rw_directory,
diff --git a/gitdb/test/db/test_ref.py b/gitdb/test/db/test_ref.py
index 664aa54..0816e64 100644
--- a/gitdb/test/db/test_ref.py
+++ b/gitdb/test/db/test_ref.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 from gitdb.test.db.lib import (
     TestDBBase,
     with_rw_directory,
diff --git a/gitdb/test/lib.py b/gitdb/test/lib.py
index da59d3b..8e60234 100644
--- a/gitdb/test/lib.py
+++ b/gitdb/test/lib.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Utilities used in ODB testing"""
 from gitdb import OStream
 
diff --git a/gitdb/test/performance/lib.py b/gitdb/test/performance/lib.py
index fa4dd20..36916ed 100644
--- a/gitdb/test/performance/lib.py
+++ b/gitdb/test/performance/lib.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Contains library functions"""
 from gitdb.test.lib import TestBase
 
diff --git a/gitdb/test/performance/test_pack.py b/gitdb/test/performance/test_pack.py
index f034baf..fc3d334 100644
--- a/gitdb/test/performance/test_pack.py
+++ b/gitdb/test/performance/test_pack.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Performance tests for object store"""
 
 from gitdb.test.performance.lib import (
diff --git a/gitdb/test/performance/test_pack_streaming.py b/gitdb/test/performance/test_pack_streaming.py
index db790f1..80c798b 100644
--- a/gitdb/test/performance/test_pack_streaming.py
+++ b/gitdb/test/performance/test_pack_streaming.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Specific test for pack streams only"""
 
 from gitdb.test.performance.lib import (
diff --git a/gitdb/test/performance/test_stream.py b/gitdb/test/performance/test_stream.py
index 91dc891..fb10871 100644
--- a/gitdb/test/performance/test_stream.py
+++ b/gitdb/test/performance/test_stream.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Performance data streaming performance"""
 
 from gitdb.test.performance.lib import TestBigRepoR
diff --git a/gitdb/test/test_base.py b/gitdb/test/test_base.py
index 519cdfd..8fc9e35 100644
--- a/gitdb/test/test_base.py
+++ b/gitdb/test/test_base.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Test for object db"""
 from gitdb.test.lib import (
     TestBase,
diff --git a/gitdb/test/test_example.py b/gitdb/test/test_example.py
index cc4d40d..3b4c908 100644
--- a/gitdb/test/test_example.py
+++ b/gitdb/test/test_example.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Module with examples from the tutorial section of the docs"""
 import os
 from gitdb.test.lib import TestBase
diff --git a/gitdb/test/test_pack.py b/gitdb/test/test_pack.py
index f946197..e723482 100644
--- a/gitdb/test/test_pack.py
+++ b/gitdb/test/test_pack.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Test everything about packs reading and writing"""
 from gitdb.test.lib import (
     TestBase,
@@ -242,7 +242,7 @@ def rewind_streams():
         # END for each info
         assert count == len(pack_objs)
         entity.close()
-        
+
     def test_pack_64(self):
         # TODO: hex-edit a pack helping us to verify that we can handle 64 byte offsets
         # of course without really needing such a huge pack
diff --git a/gitdb/test/test_stream.py b/gitdb/test/test_stream.py
index 5e2e1ba..1e7e941 100644
--- a/gitdb/test/test_stream.py
+++ b/gitdb/test/test_stream.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Test for object db"""
 
 from gitdb.test.lib import (
diff --git a/gitdb/test/test_util.py b/gitdb/test/test_util.py
index 3b3165d..166b33c 100644
--- a/gitdb/test/test_util.py
+++ b/gitdb/test/test_util.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Test for object db"""
 import tempfile
 import os
diff --git a/gitdb/typ.py b/gitdb/typ.py
index 98d15f3..314db50 100644
--- a/gitdb/typ.py
+++ b/gitdb/typ.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 """Module containing information about types known to the database"""
 
 str_blob_type = b'blob'
diff --git a/gitdb/util.py b/gitdb/util.py
index 3151c06..bb6d879 100644
--- a/gitdb/util.py
+++ b/gitdb/util.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
 #
 # This module is part of GitDB and is released under
-# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
+# the New BSD License: https://opensource.org/license/bsd-3-clause/
 import binascii
 import os
 import mmap

From cd8da415e119451e195903576a8ff22cf60ae47b Mon Sep 17 00:00:00 2001
From: Eliah Kagan <degeneracypressure@gmail.com>
Date: Tue, 3 Oct 2023 12:42:23 -0400
Subject: [PATCH 13/18] Run CI on all branches

This makes it easier to test changes to CI without/before a PR.

+ Fix a small YAML indentation style inconsistency.
---
 .github/workflows/pythonpackage.yml | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml
index 6849763..6d819ff 100644
--- a/.github/workflows/pythonpackage.yml
+++ b/.github/workflows/pythonpackage.yml
@@ -3,11 +3,7 @@
 
 name: Python package
 
-on:
-  push:
-    branches: [ master ]
-  pull_request:
-    branches: [ master ]
+on: [push, pull_request, workflow_dispatch]
 
 jobs:
   build:
@@ -17,9 +13,9 @@ jobs:
       matrix:
         python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
         include:
-          - experimental: false
-          - python-version: "3.12"
-            experimental: true
+        - experimental: false
+        - python-version: "3.12"
+          experimental: true
     continue-on-error: ${{ matrix.experimental }}
 
     steps:

From 00bbc44eff7be0b43a882eadf54c2bbb2f9000a0 Mon Sep 17 00:00:00 2001
From: Eliah Kagan <degeneracypressure@gmail.com>
Date: Tue, 3 Oct 2023 12:44:38 -0400
Subject: [PATCH 14/18] No longer treat 3.12 as experimental on CI

Since Python 3.12.0 stable has been released, as well as now being
available via setup-python, per:
https://github.com/actions/python-versions/blob/main/versions-manifest.json

The main practical effect of this is that continue-on-error is no
longer set to true for 3.12, so 3.12 is no longer special-cased to
refrain from cancelling other test jobs when its test job fails.

Another effect is that 3.12 can longer be selected as a prerelease.
---
 .github/workflows/pythonpackage.yml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml
index 6d819ff..73b3902 100644
--- a/.github/workflows/pythonpackage.yml
+++ b/.github/workflows/pythonpackage.yml
@@ -14,8 +14,6 @@ jobs:
         python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
         include:
         - experimental: false
-        - python-version: "3.12"
-          experimental: true
     continue-on-error: ${{ matrix.experimental }}
 
     steps:

From 70098c9c99db872ac98a6b5c7a591a42cadf049f Mon Sep 17 00:00:00 2001
From: DeflateAwning <11021263+DeflateAwning@users.noreply.github.com>
Date: Fri, 6 Oct 2023 12:22:44 -0600
Subject: [PATCH 15/18] Add __all__ to exc for linting

---
 gitdb/exc.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gitdb/exc.py b/gitdb/exc.py
index 7397037..752dafd 100644
--- a/gitdb/exc.py
+++ b/gitdb/exc.py
@@ -5,6 +5,17 @@
 """Module with common exceptions"""
 from gitdb.util import to_hex_sha
 
+__all__ = [
+    'AmbiguousObjectName',
+    'BadName',
+    'BadObject',
+    'BadObjectType',
+    'InvalidDBRoot',
+    'ODBError',
+    'ParseError',
+    'UnsupportedOperation',
+    'to_hex_sha',
+]
 
 class ODBError(Exception):
     """All errors thrown by the object database"""

From 12db86cefa90e8fc1c8df8f5c6b4c8b7a232d773 Mon Sep 17 00:00:00 2001
From: Eliah Kagan <degeneracypressure@gmail.com>
Date: Fri, 13 Oct 2023 04:06:47 -0400
Subject: [PATCH 16/18] Have Dependabot update smmap submodule dependency

This makes Dependabot open version update PRs for submodules
(which here is just smmap), as well as GitHub Actions. This is
like https://github.com/gitpython-developers/GitPython/pull/1702.
---
 .github/dependabot.yml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 203f3c8..5acde1a 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -3,4 +3,9 @@ updates:
 - package-ecosystem: "github-actions"
   directory: "/"
   schedule:
-      interval: "weekly"
+    interval: "weekly"
+
+- package-ecosystem: "gitsubmodule"
+  directory: "/"
+  schedule:
+    interval: "monthly"

From 8e613962153baad0431358dda03d9fd942cef616 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 13 Oct 2023 08:17:45 +0000
Subject: [PATCH 17/18] Bump gitdb/ext/smmap from `334ef84` to `f1ace75`

Bumps [gitdb/ext/smmap](https://github.com/gitpython-developers/smmap) from `334ef84` to `f1ace75`.
- [Commits](https://github.com/gitpython-developers/smmap/compare/334ef84a05c953ed5dbec7b9c6d4310879eeab5a...f1ace75be355fdec927793e462b9b12bf6ec9520)

---
updated-dependencies:
- dependency-name: gitdb/ext/smmap
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
---
 gitdb/ext/smmap | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gitdb/ext/smmap b/gitdb/ext/smmap
index 334ef84..f1ace75 160000
--- a/gitdb/ext/smmap
+++ b/gitdb/ext/smmap
@@ -1 +1 @@
-Subproject commit 334ef84a05c953ed5dbec7b9c6d4310879eeab5a
+Subproject commit f1ace75be355fdec927793e462b9b12bf6ec9520

From 2057ae67b85fb9925efbd0f00f44413e506e286c Mon Sep 17 00:00:00 2001
From: Sebastian Thiel <sebastian.thiel@icloud.com>
Date: Fri, 20 Oct 2023 09:37:58 +0200
Subject: [PATCH 18/18] bump versions to prepare for next release

---
 doc/source/changes.rst | 6 ++++++
 gitdb/__init__.py      | 2 +-
 gitdb/ext/smmap        | 2 +-
 setup.py               | 2 +-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/doc/source/changes.rst b/doc/source/changes.rst
index 7d85ea5..0b8de13 100644
--- a/doc/source/changes.rst
+++ b/doc/source/changes.rst
@@ -2,6 +2,12 @@
 Changelog
 #########
 
+******
+4.0.11
+******
+
+- various improvements - please see the release on GitHub for details.
+
 ******
 4.0.10
 ******
diff --git a/gitdb/__init__.py b/gitdb/__init__.py
index 2fb3f7e..803a428 100644
--- a/gitdb/__init__.py
+++ b/gitdb/__init__.py
@@ -28,7 +28,7 @@ def _init_externals():
 __author__ = "Sebastian Thiel"
 __contact__ = "byronimo@gmail.com"
 __homepage__ = "https://github.com/gitpython-developers/gitdb"
-version_info = (4, 0, 10)
+version_info = (4, 0, 11)
 __version__ = '.'.join(str(i) for i in version_info)
 
 
diff --git a/gitdb/ext/smmap b/gitdb/ext/smmap
index f1ace75..256c5a2 160000
--- a/gitdb/ext/smmap
+++ b/gitdb/ext/smmap
@@ -1 +1 @@
-Subproject commit f1ace75be355fdec927793e462b9b12bf6ec9520
+Subproject commit 256c5a21de2d14aca02c9689d7d63f78c4e0ef61
diff --git a/setup.py b/setup.py
index 61b5727..f67f7a5 100755
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@
 __author__ = "Sebastian Thiel"
 __contact__ = "byronimo@gmail.com"
 __homepage__ = "https://github.com/gitpython-developers/gitdb"
-version_info = (4, 0, 10)
+version_info = (4, 0, 11)
 __version__ = '.'.join(str(i) for i in version_info)
 
 setup(