File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -324,9 +324,24 @@ clean-stm:
324
324
$(MAKE ) -C ports/stm BOARD=feather_stm32f405_express clean
325
325
326
326
327
- # Do blobless partial clones of submodules to save time and space.
327
+ # If available, do blobless partial clones of submodules to save time and space.
328
328
# A blobless partial clone lazily fetches data as needed, but has all the metadata available (tags, etc.)
329
329
# so it does not have the idiosyncrasies of a shallow clone.
330
+ #
331
+ # If not available, do a fetch that will fail, and then fix it up with a second fetch.
332
+ # (Only works for git servers that allow sha fetches.)
330
333
.PHONY : fetch-submodules
331
334
fetch-submodules :
332
- git submodule update --init --filter=blob:none
335
+ git submodule sync
336
+ # ####################################################################################
337
+ # NOTE: Ideally, use git version 2.36.0 or later, to do partial clones of submodules.
338
+ # If an older git is used, submodules will be cloned with a shallow clone of depth 1.
339
+ # You will see a git usage message first if the git version is too old to do
340
+ # clones of submodules.
341
+ # ####################################################################################
342
+ git submodule update --init --filter=blob:none || git submodule update --init -N --depth 1 || git submodule foreach ' git fetch --tags --depth 1 origin $$sha1 && git checkout -q $$sha1' || echo ' make fetch-submodules FAILED'
343
+
344
+ .PHONY : remove-submodules
345
+ remove-submodules :
346
+ git submodule deinit -f --all
347
+ rm -rf .git/modules/*
You can’t perform that action at this time.
0 commit comments