From 1f131a1a8d87da612ecfacfca28b2fd2f8ac061f Mon Sep 17 00:00:00 2001 From: Leona Maroni Date: Sat, 7 Feb 2026 12:12:40 +0100 Subject: [PATCH] gitaly.git: remove leaveDotGit from src FOD and modernize leaveDotGit is currently very unstable for this FOD. Gitaly normally clones the Git repo. This change changes this behaviour to just copy Git. --- .../gi/gitaly/dont-clone-git-repo.patch | 19 +++++++++++++++++++ pkgs/by-name/gi/gitaly/git-data.json | 2 +- pkgs/by-name/gi/gitaly/git.nix | 16 ++++++++++------ pkgs/by-name/gi/gitlab/update.py | 2 +- 4 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 pkgs/by-name/gi/gitaly/dont-clone-git-repo.patch diff --git a/pkgs/by-name/gi/gitaly/dont-clone-git-repo.patch b/pkgs/by-name/gi/gitaly/dont-clone-git-repo.patch new file mode 100644 index 000000000000..aaf30d9eb16d --- /dev/null +++ b/pkgs/by-name/gi/gitaly/dont-clone-git-repo.patch @@ -0,0 +1,19 @@ +diff --git a/Makefile b/Makefile +index e75c22e80b..f702da6f80 100644 +--- a/Makefile ++++ b/Makefile +@@ -757,12 +757,8 @@ + # otherwise try to rebuild all targets depending on it whenever we build + # something else. We thus depend on the Makefile instead. + ${DEPENDENCY_DIR}/git-%/Makefile: ${DEPENDENCY_DIR}/git-%.version +- ${Q}${GIT} -c init.defaultBranch=master init ${GIT_QUIET} "${@D}" +- ${Q}${GIT} -C "${@D}" config remote.origin.url ${GIT_REPO_URL} +- ${Q}${GIT} -C "${@D}" config remote.origin.tagOpt --no-tags +- ${Q}${GIT} -C "${@D}" fetch --depth 1 ${GIT_QUIET} origin ${GIT_VERSION} +- ${Q}${GIT} -C "${@D}" reset --hard +- ${Q}${GIT} -C "${@D}" checkout ${GIT_QUIET} --detach FETCH_HEAD ++ cp -r ${GIT_REPO_PATH} "${@D}" ++ chmod -R oga+rw "${@D}" + ifeq ($(OVERRIDE_GIT_VERSION),) + ${Q}rm -f "${@D}"/version + else diff --git a/pkgs/by-name/gi/gitaly/git-data.json b/pkgs/by-name/gi/gitaly/git-data.json index 23a6985947eb..50190465fa0e 100644 --- a/pkgs/by-name/gi/gitaly/git-data.json +++ b/pkgs/by-name/gi/gitaly/git-data.json @@ -1,5 +1,5 @@ { "version": "2.52-a37bb2ae", "rev": "a37bb2ae6c6659cf7cefd0412759fca5202a823d", - "hash": "sha256-7yUjXiaFwPG9o4n+IieYNTJKtzyawQFHooNrikpbiEM=" + "hash": "sha256-A1FOzmVe2e73pie0WYJPwsKOb5BGNrusGy0wXa9ruvI=" } diff --git a/pkgs/by-name/gi/gitaly/git.nix b/pkgs/by-name/gi/gitaly/git.nix index ce1a0a51858d..793627658ff6 100644 --- a/pkgs/by-name/gi/gitaly/git.nix +++ b/pkgs/by-name/gi/gitaly/git.nix @@ -13,16 +13,15 @@ let data = lib.importJSON ./git-data.json; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { inherit (data) version; pname = "gitaly-git"; - # `src` attribute for nix-update src = fetchFromGitLab { owner = "gitlab-org"; repo = "git"; inherit (data) rev hash; - leaveDotGit = true; + fetchSubmodules = true; }; # Use gitaly and their build system as source root @@ -32,10 +31,15 @@ stdenv.mkDerivation rec { git config --global --add safe.directory '*' ''; - sourceRoot = src.name; + # This is a patch for gitaly, not git + patches = [ + ./dont-clone-git-repo.patch + ]; + + sourceRoot = finalAttrs.src.name; buildFlags = [ "install-git" ]; - GIT_REPO_URL = src; + GIT_REPO_PATH = finalAttrs.src; HOME = "/build"; nativeBuildInputs = [ @@ -76,4 +80,4 @@ stdenv.mkDerivation rec { platforms = lib.platforms.all; teams = [ lib.teams.gitlab ]; }; -} +}) diff --git a/pkgs/by-name/gi/gitlab/update.py b/pkgs/by-name/gi/gitlab/update.py index 2c8f64524ff6..dadd442ce871 100755 --- a/pkgs/by-name/gi/gitlab/update.py +++ b/pkgs/by-name/gi/gitlab/update.py @@ -279,7 +279,7 @@ def update_gitaly(): NIXPKGS_PATH, "-H", "-a", - "leaveDotGit", + "fetchSubmodules", "true", "https://gitlab.com/gitlab-org/git", git_rev