From 457663fc5157bc37f9b9761199624f690a9e0394 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Wed, 6 Nov 2024 10:31:28 +1100 Subject: [PATCH] py/mkrules.mk: Use partial clone for submodules if available. Signed-off-by: Andrew Leech --- py/mkrules.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/py/mkrules.mk b/py/mkrules.mk index 0dc1cdfe15ac4..0ac0d4c76eea8 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -252,7 +252,11 @@ submodules: $(ECHO) "Updating submodules: $(GIT_SUBMODULES)" ifneq ($(GIT_SUBMODULES),) $(Q)cd $(TOP) && git submodule sync $(GIT_SUBMODULES) - $(Q)cd $(TOP) && git submodule update --init $(GIT_SUBMODULES) + # If available, do blobless partial clones of submodules to save time and space. + # A blobless partial clone lazily fetches data as needed, but has all the metadata available (tags, etc.). + # Fallback to standard submodule update if blobless isn't available (earlier than 2.36.0) + $(Q)cd $(TOP) && git submodule update --init $(GIT_SUBMODULES) --filter=blob:none || \ + git submodule update --init $(GIT_SUBMODULES) endif .PHONY: submodules