[llvm] Increase git fetch depth (PR #70946)

Chris B via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 1 10:20:20 PDT 2023


https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/70946

>From 8782309430690b6a571528c759eeaee983d5ec27 Mon Sep 17 00:00:00 2001
From: Chris Bieneman <chris.bieneman at me.com>
Date: Wed, 1 Nov 2023 10:12:10 -0500
Subject: [PATCH 1/2] Increase git fetch depth

We've gotten ~750 commits in the last 7 days. Upping the fetch depth to
2000 will make it more likely that PRs up to 2 weeks old will have
enough fetch history to find a common parent. This _might_ address some
of the failures we're seeing in the clang-format action where it cannot
find a common base commit.
---
 .github/workflows/pr-code-format.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/pr-code-format.yml b/.github/workflows/pr-code-format.yml
index 3a91ffb0b1ad9a7..5978d503f6f35d3 100644
--- a/.github/workflows/pr-code-format.yml
+++ b/.github/workflows/pr-code-format.yml
@@ -10,14 +10,14 @@ jobs:
       - name: Fetch LLVM sources
         uses: actions/checkout at v4
         with:
-          fetch-depth: 2
+          fetch-depth: 2000 # Fetches only the last 2000 commits
 
       - name: Get changed files
         id: changed-files
         uses: tj-actions/changed-files at v39
         with:
           separator: ","
-          fetch_depth: 100 # Fetches only the last 10 commits
+          fetch_depth: 2000 # Fetches only the last 2000 commits
 
       - name: "Listed files"
         run: |

>From 2cb0e0d246a4fd3d32e39bd5756735228ea3d289 Mon Sep 17 00:00:00 2001
From: Chris Bieneman <chris.bieneman at me.com>
Date: Wed, 1 Nov 2023 12:19:06 -0500
Subject: [PATCH 2/2] Leave fetch-depth on checkout as 2

The changed-files plugin fetches both the target and the PR branch to
the specified depths, so we don't need to also fetch the target
separately at a deeper depth.
---
 .github/workflows/pr-code-format.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/pr-code-format.yml b/.github/workflows/pr-code-format.yml
index 5978d503f6f35d3..fa0e69211b14788 100644
--- a/.github/workflows/pr-code-format.yml
+++ b/.github/workflows/pr-code-format.yml
@@ -10,7 +10,7 @@ jobs:
       - name: Fetch LLVM sources
         uses: actions/checkout at v4
         with:
-          fetch-depth: 2000 # Fetches only the last 2000 commits
+          fetch-depth: 2 # Fetches only the last 2 commits
 
       - name: Get changed files
         id: changed-files



More information about the llvm-commits mailing list