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.
This commit is contained in:
Leona Maroni
2026-02-07 12:12:40 +01:00
parent d45159d86a
commit 1f131a1a8d
4 changed files with 31 additions and 8 deletions
@@ -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
+1 -1
View File
@@ -1,5 +1,5 @@
{
"version": "2.52-a37bb2ae",
"rev": "a37bb2ae6c6659cf7cefd0412759fca5202a823d",
"hash": "sha256-7yUjXiaFwPG9o4n+IieYNTJKtzyawQFHooNrikpbiEM="
"hash": "sha256-A1FOzmVe2e73pie0WYJPwsKOb5BGNrusGy0wXa9ruvI="
}
+10 -6
View File
@@ -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 ];
};
}
})
+1 -1
View File
@@ -279,7 +279,7 @@ def update_gitaly():
NIXPKGS_PATH,
"-H",
"-a",
"leaveDotGit",
"fetchSubmodules",
"true",
"https://gitlab.com/gitlab-org/git",
git_rev