From f6932e9bd52faa4ccb2bcb40d301f6fc403c13f0 Mon Sep 17 00:00:00 2001 From: Glen Huang Date: Sat, 22 Apr 2023 13:22:28 +0800 Subject: [PATCH] scripts/feeds: use partial clone for src-git-full Partial clone is much faster without clipping history Signed-off-by: Glen Huang [also apply to include/download.mk] Signed-off-by: Tianling Shen (cherry picked from commit 31514777275184fd0f41d7af9eb1a92ecff37802) --- include/download.mk | 4 ++-- scripts/feeds | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/download.mk b/include/download.mk index 99a3e0140d..45c6f43944 100644 --- a/include/download.mk +++ b/include/download.mk @@ -203,9 +203,9 @@ define DownloadMethod/rawgit cd $(TMP_DIR)/dl && \ rm -rf $(SUBDIR) && \ [ \! -d $(SUBDIR) ] && \ - git clone $(OPTS) $(URL) $(SUBDIR) && \ + git clone --filter=blob:none $(OPTS) $(URL) $(SUBDIR) && \ (cd $(SUBDIR) && git checkout $(VERSION) && \ - git submodule update --init --recursive) && \ + git submodule update --init --recursive --filter=blob:none) && \ echo "Packing checkout..." && \ export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \ rm -rf $(SUBDIR)/.git && \ diff --git a/scripts/feeds b/scripts/feeds index 499354391b..e972a7d654 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -164,9 +164,9 @@ my %update_method = ( 'controldir' => ".git", 'revision' => "git rev-parse --short HEAD | tr -d '\n'"}, 'src-git-full' => { - 'init' => "git clone '%s' '%s'", - 'init_branch' => "git clone --branch '%s' '%s' '%s'", - 'init_commit' => "git clone '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -", + 'init' => "git clone --filter=blob:none '%s' '%s'", + 'init_branch' => "git clone --filter=blob:none --branch '%s' '%s' '%s'", + 'init_commit' => "git clone --filter=blob:none '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -", 'update' => "git pull --ff-only", 'update_force' => "git pull --ff-only || (git reset --hard HEAD; git pull --ff-only; exit 1)", 'post_update' => "git submodule update --init --recursive",