From ba592dc715eed67b0c939ded94b4c31bc5ba1070 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 30 May 2024 16:24:42 +0200 Subject: mkosi: Replace submodules with our own thing Unfortunately, git submodules break in all sorts of ways: - Various github workflows (dependabot, github pages) try to do a shallow clone of git submodules which does not work at all when the git repository is hosted on pagure (https://pagure.io/pagure/issue/5453, https://github.com/dependabot/dependabot-core/issues/9391). - If the git forge hosting the git repository uses SHA256, then it breaks our usage of it as a submodule as SHA256 repositories cannot be used as submodules in SHA1 repositories (src.opensuse.org moved to SHA256 which broke our usage of opensuse's systemd spec as a submodule). - git submodules completely break usage of git worktrees. - ... Let's avoid all these issues by just doing our own home grown implementation of git submodules. We lose the automatic dependabot updates this way but since dependabot fails to run more often that not with submodules we don't really lose anything. --- tools/git-setup.sh | 18 ------------------ tools/git-submodule-update-hook.sh | 4 ---- 2 files changed, 22 deletions(-) delete mode 100755 tools/git-submodule-update-hook.sh (limited to 'tools') diff --git a/tools/git-setup.sh b/tools/git-setup.sh index 8cc1bfdfc2..b5903b4ca1 100755 --- a/tools/git-setup.sh +++ b/tools/git-setup.sh @@ -4,12 +4,6 @@ set -eu cd "${MESON_SOURCE_ROOT:?}" -if [ -e .git ]; then - git config submodule.recurse true - git config fetch.recurseSubmodules on-demand - git config push.recurseSubmodules no -fi - ret=2 if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then @@ -19,16 +13,4 @@ if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then ret=0 fi -if [ ! -f .git/hooks/post-rewrite ]; then - cp -p tools/git-submodule-update-hook.sh .git/hooks/post-rewrite - echo 'Activated post-rewrite hook' - ret=0 -fi - -if [ ! -f .git/hooks/post-checkout ]; then - cp -p tools/git-submodule-update-hook.sh .git/hooks/post-checkout - echo 'Activated post-checkout hook' - ret=0 -fi - exit $ret diff --git a/tools/git-submodule-update-hook.sh b/tools/git-submodule-update-hook.sh deleted file mode 100755 index 78feb9dbba..0000000000 --- a/tools/git-submodule-update-hook.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: LGPL-2.1-or-later - -exec git submodule update -- cgit v1.2.3