From 9825e97a83bd29085c8eaaf032d837ba090f23b7 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 7 Jun 2024 12:50:55 +0100 Subject: [PATCH] git.sh: *never* run git submodule update only use config/submodules/ which the build system then uses to run git clones manually, replicating the submodules feature. we must never use a project's own gitmodules feature, because we can't easily control it. better to let it break first, and then figure out what modules to add manually, so that we have only what we need for each project. it's done this way, because git's own submodules feature doesn't have very good error checking in general, nor does it have good redundancy. with the current design, we can declare backup repositories for each submodule. we replicate it precisely. for example: 3rdparty/vboot this is a coreboot submodule, and we handle that in the coreboot trees. however, our current design also allows you to do this even if the upstream repository does not contain a .gitmodules file Signed-off-by: Leah Rowe --- include/git.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/git.sh b/include/git.sh index 45ffc67..8af1f0d 100755 --- a/include/git.sh +++ b/include/git.sh @@ -109,9 +109,6 @@ prep_submodules() if [ -f "$mdir/module.list" ]; then cat "$mdir/module.list" > "$tmpdir/modules" || \ $err "!cp $mdir/module.list $tmpdir/modules" - elif [ -f "$tmpgit/.gitmodules" ]; then - git -C "$tmpgit" submodule status | awk '{print $2}' > \ - "$tmpdir/modules" || $err "$mdir: cannot list submodules" else return 0 fi @@ -141,9 +138,6 @@ fetch_submodule() [ -d "$tmpgit/$1" ] && break done [ -d "$tmpgit/$1" ] || $err "!clone $mod $project $mcfgdir $1" - else - git -C "$tmpgit" submodule update --init -- "$1" || $err \ - "$mdir: !update $1" fi }