[3.15] gh-151365: Temporarily downgrade Git to prevent fatal error (GH-155495) (#155532)

hugovk <[email protected]> Tue, 11 Aug 2026 01:29:03 -0400 (EDT)
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/74da6fb46d7f15fe798e689ce1b848d7e1cdf1c5
commit: 74da6fb46d7f15fe798e689ce1b848d7e1cdf1c5
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2026-08-11T05:28:46Z
summary:

[3.15] gh-151365: Temporarily downgrade Git to prevent fatal error (GH-155495) (#155532)

Co-authored-by: Hugo van Kemenade <[email protected]>

files:
M .github/workflows/reusable-check-html-ids.yml
M .github/workflows/reusable-context.yml
M .github/workflows/reusable-docs.yml

diff --git a/.github/workflows/reusable-check-html-ids.yml b/.github/workflows/reusable-check-html-ids.yml
index 4f827c55cacd06..2d43d09db42128 100644
--- a/.github/workflows/reusable-check-html-ids.yml
+++ b/.github/workflows/reusable-check-html-ids.yml
@@ -20,6 +20,13 @@ jobs:
         with:
           persist-credentials: false
           ref: ${{ github.event.pull_request.head.sha }}
+      - name: 'Downgrade Git'
+        # Temporarily downgrade to 2.43 until 2.55 is in the runner image,
+        # to avoid "fatal: shallow file has changed since we read it" bug.
+        # See https://github.com/python/cpython/issues/151365.
+        run: |
+          sudo apt-get install -y --allow-downgrades 'git=1:2.43.*' 'git-man=1:2.43.*'
+          git --version
       - name: 'Find merge base'
         id: merge-base
         run: |
diff --git a/.github/workflows/reusable-context.yml b/.github/workflows/reusable-context.yml
index b8a9e2960eca59..08c31981d47208 100644
--- a/.github/workflows/reusable-context.yml
+++ b/.github/workflows/reusable-context.yml
@@ -94,6 +94,15 @@ jobs:
             || ''
           }}
 
+    - name: 'Downgrade Git'
+      # Temporarily downgrade to 2.43 until 2.55 is in the runner image,
+      # to avoid "fatal: shallow file has changed since we read it" bug.
+      # See https://github.com/python/cpython/issues/151365.
+      if: github.event_name == 'pull_request'
+      run: |
+        sudo apt-get install -y --allow-downgrades 'git=1:2.43.*' 'git-man=1:2.43.*'
+        git --version
+
     # Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
     - name: Fetch commits to get branch diff
       if: github.event_name == 'pull_request'
diff --git a/.github/workflows/reusable-docs.yml b/.github/workflows/reusable-docs.yml
index abc82f5463eb4e..b3909faaec530a 100644
--- a/.github/workflows/reusable-docs.yml
+++ b/.github/workflows/reusable-docs.yml
@@ -47,6 +47,14 @@ jobs:
             && github.event.pull_request.head.sha
             || ''
           }}
+    - name: 'Downgrade Git'
+      # Temporarily downgrade to 2.43 until 2.55 is in the runner image,
+      # to avoid "fatal: shallow file has changed since we read it" bug.
+      # See https://github.com/python/cpython/issues/151365.
+      if: github.event_name == 'pull_request'
+      run: |
+        sudo apt-get install -y --allow-downgrades 'git=1:2.43.*' 'git-man=1:2.43.*'
+        git --version
     # Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
     - name: 'Fetch commits to get branch diff'
       if: github.event_name == 'pull_request'

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]