summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorNicolas Benes <nbenes.gh@xandea.de>2022-11-07 19:42:19 +0100
committerNicolas Benes <nbenes.gh@xandea.de>2022-11-15 19:45:33 +0100
commitf6b07f0e2f5834b1fd6432a0f4c2bc11096e53ed (patch)
tree2fe547a476d49c253d605f78dfe06f37516463f4 /doc
parent79e84ba085c152323f9f960d7b7e34730731f2bf (diff)
fetchgit: make sparseCheckout a list of strings
The `sparseCheckout` argument allows the user to specify directories or
patterns of files, which Git uses to filter files it should check-out.

Git expects a multi-line string on stdin ("newline-delimited list", see
`git-sparse-checkout(1)`), but within nixpkgs it is more consistent to
use a list of strings instead. The list elements are joined to a
multi-line string only before passing it to the builder script.

A deprecation warning is emitted if a (multi-line) string is passed to
`sparseCheckout`, but for the time being it is still accepted.
Diffstat (limited to 'doc')
-rw-r--r--doc/builders/fetchers.chapter.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/builders/fetchers.chapter.md b/doc/builders/fetchers.chapter.md
index 12d8a5d887fd4..43aead0ad5e44 100644
--- a/doc/builders/fetchers.chapter.md
+++ b/doc/builders/fetchers.chapter.md
@@ -100,10 +100,10 @@ stdenv.mkDerivation {
   name = "hello";
   src = fetchgit {
     url = "https://...";
-    sparseCheckout = ''
-      directory/to/be/included
-      another/directory
-    '';
+    sparseCheckout = [
+      "directory/to/be/included"
+      "another/directory"
+    ];
     sha256 = "0000000000000000000000000000000000000000000000000000";
   };
 }