summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorpsakievich <psakiev@sandia.gov>2024-08-14 23:28:34 -0600
committerGitHub <noreply@github.com>2024-08-15 05:28:34 +0000
commit1b82779087ed4bb7b90d30da02ffff9b655d6fcc (patch)
tree61a2dd234bc950f63cbbd8191937a89278e8f218 /var
parent55b1b0f3f039d35c71fd775be5bbed0f071c0bb2 (diff)
downloadspack-1b82779087ed4bb7b90d30da02ffff9b655d6fcc.tar.gz
spack-1b82779087ed4bb7b90d30da02ffff9b655d6fcc.tar.bz2
spack-1b82779087ed4bb7b90d30da02ffff9b655d6fcc.tar.xz
spack-1b82779087ed4bb7b90d30da02ffff9b655d6fcc.zip
Add options for sparse checkout in GitFetcher (#45473)
* Add options for sparse checkout in GitFetcher Newer versions of git have a beta feature called sparse checkout that allow users to check out a portion of a large repo. This feature will be ideal for monolithic repo projects that want to model their infrastructure via spack. This PR implements an addition to the GitFetcher that allows users to add a `git_sparse_paths` attribute to package classes or versions which will then use sparse checkout on those directories/files for the package. * Style * Split git clone into multiple functions * Add sparse-checkout impl * Internalize src clone functions * Docs * Adding sparse clone test * Add test for partial clone * [@spackbot] updating style on behalf of psakievich * Small fixes * Restore default branch status * Fix attributes for package * Update lib/spack/docs/packaging_guide.rst Co-authored-by: Matthew Mosby <44072882+mdmosby@users.noreply.github.com> * Extend unit test to multiple git versions * style --------- Co-authored-by: psakievich <psakievich@users.noreply.github.com> Co-authored-by: Matthew Mosby <44072882+mdmosby@users.noreply.github.com>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/git-sparsepaths-pkg/package.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/git-sparsepaths-pkg/package.py b/var/spack/repos/builtin.mock/packages/git-sparsepaths-pkg/package.py
new file mode 100644
index 0000000000..b37aba8660
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/git-sparsepaths-pkg/package.py
@@ -0,0 +1,17 @@
+# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack.package import *
+
+
+class GitSparsepathsPkg(Package):
+ """Mock package with git_sparse_paths attribute"""
+
+ homepage = "http://www.git-fetch-example.com"
+ git = "https://a/really.com/big/repo.git"
+
+ version("1.0", tag="v1.0")
+
+ git_sparse_paths = ["foo", "bar", "bing/bang"]