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

Chris B via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 1 11:05:57 PDT 2023


llvm-beanz wrote:

I'm also experimenting with a more permanent fix. I was thinking about adding something like:

```yaml
     - name: Find merge base
        env:
          PR_NUMBER: ${{ github.event.number }}
        run: |
          until git merge-base $GITHUB_SHA pull/$PR_NUMBER
            do
            depth=$((depth+1000))
            git fetch --depth=$depth origin $GITHUB_HEAD_REF
            git fetch --depth=$depth origin refs/pull/$PR_NUMBER/head:pull/$PR_NUMBER
            if [ "$depth" -gt "10000" ]
            then
              exit 1
            fi
          done
```

That would incrementally walk up the depth until it either finds a merge base or tries too many times.

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


More information about the llvm-commits mailing list