[前][次][番号順一覧][スレッド一覧]

ruby-changes:58781

From: Kazuhiro <ko1@a...>
Date: Wed, 13 Nov 2019 20:21:32 +0900 (JST)
Subject: [ruby-changes:58781] 7f2c98b11d (master): Use shallow-since instead of depth

https://git.ruby-lang.org/ruby.git/commit/?id=7f2c98b11d

From 7f2c98b11d9eedd7028a1ccb2c1f88db71db28ca Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA <zn@m...>
Date: Wed, 13 Nov 2019 19:56:33 +0900
Subject: Use shallow-since instead of depth

commit number of today requires log since 0:00 UTC.
So commits of 24 hours are enough.

https://www.git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt
> Implies --single-branch unless --no-single-branch is given to fetch the histories near the tips of all branches.

So I add `--single-branch` too.

diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index b0cd602..1f98727 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -22,12 +22,12 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/macos.yml#L22
       # Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
       - name: Checkout ruby/ruby
         run: |
-          git clone --depth=50 https://github.com/ruby/ruby src
+          git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
           git -C src reset --hard "$GITHUB_SHA"
         if: github.event_name == 'push'
       - name: Checkout a pull request
         run: |
-          git clone --depth=50 "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
+          git clone --single-branch --shallow-since=yesterday "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
           git -C src reset --hard "$GITHUB_REV"
         env:
           GITHUB_REV: ${{ github.event.pull_request.head.sha }}
diff --git a/.github/workflows/mjit.yml b/.github/workflows/mjit.yml
index 898ea56..26533fa 100644
--- a/.github/workflows/mjit.yml
+++ b/.github/workflows/mjit.yml
@@ -23,12 +23,12 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit.yml#L23
       # Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
       - name: Checkout ruby/ruby
         run: |
-          git clone --depth=50 https://github.com/ruby/ruby src
+          git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
           git -C src reset --hard "$GITHUB_SHA"
         if: github.event_name == 'push'
       - name: Checkout a pull request
         run: |
-          git clone --depth=50 "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
+          git clone --single-branch --shallow-since=yesterday "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
           git -C src reset --hard "$GITHUB_REV"
         env:
           GITHUB_REV: ${{ github.event.pull_request.head.sha }}
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index 847e4a1..e819884 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -55,12 +55,12 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/ubuntu.yml#L55
       # Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
       - name: Checkout ruby/ruby
         run: |
-          git clone --depth=50 https://github.com/ruby/ruby src
+          git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
           git -C src reset --hard "$GITHUB_SHA"
         if: github.event_name == 'push'
       - name: Checkout a pull request
         run: |
-          git clone --depth=50 "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
+          git clone --single-branch --shallow-since=yesterday "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
           git -C src reset --hard "$GITHUB_REV"
         env:
           GITHUB_REV: ${{ github.event.pull_request.head.sha }}
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index 8dd546b..e2597df 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -46,12 +46,12 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L46
       # Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
       - name: Checkout ruby/ruby
         run: |
-          git clone --depth=50 https://github.com/ruby/ruby src
+          git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
           git -C src reset --hard ${{ github.sha }}
         if: github.event_name == 'push'
       - name: Checkout a pull request
         run: |
-          git clone --depth=50 --branch=${{ github.event.pull_request.head.ref }} https://github.com/${{ github.event.pull_request.head.repo.full_name }} src
+          git clone --single-branch --shallow-since=yesterday --branch=${{ github.event.pull_request.head.ref }} https://github.com/${{ github.event.pull_request.head.repo.full_name }} src
           git -C src reset --hard ${{ github.event.pull_request.head.sha }}
         if: github.event_name == 'pull_request'
       - run: ./src/tool/actions-commit-info.sh
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]