+2
-2
lib/fileset/default.nix
+2
-2
lib/fileset/default.nix
···`gitTrackedWith` does not perform any filtering when the path is a [Nix store path](https://nixos.org/manual/nix/stable/store/store-path.html#store-path) and not a repository.In this way, it accommodates the use case where the expression that makes the `gitTracked` call does not reside in an actual git repository anymore,-Fetchers with such equivalent behavior include `fetchGit`, `fetchTree` (experimental), and `pkgs.fetchgit` when used without `leaveDotGit`.···(which uses [`--cached`](https://git-scm.com/docs/git-ls-files#Documentation/git-ls-files.txt--c) by default).-Currently this function is based on [`fetchGit`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-fetchGit)
···`gitTrackedWith` does not perform any filtering when the path is a [Nix store path](https://nixos.org/manual/nix/stable/store/store-path.html#store-path) and not a repository.In this way, it accommodates the use case where the expression that makes the `gitTracked` call does not reside in an actual git repository anymore,+Fetchers with such equivalent behavior include `builtins.fetchGit`, `builtins.fetchTree` (experimental), and `pkgs.fetchgit` when used without `leaveDotGit`.···(which uses [`--cached`](https://git-scm.com/docs/git-ls-files#Documentation/git-ls-files.txt--c) by default).+Currently this function is based on [`builtins.fetchGit`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-fetchGit)
+4
-4
lib/fileset/internal.nix
+4
-4
lib/fileset/internal.nix
···lib.fileset.${function}: The ${argument} (${toString path}) is a store path within a working tree of a Git repository.This indicates that a source directory was imported into the store using a method such as `import "''${./.}"` or `path:.`.-This function currently does not support such a use case, since it currently relies on `fetchGit`.You could make this work by using a fetcher such as `fetchGit` instead of copying the whole repository.If you can't avoid copying the repo to the store, see https://github.com/NixOS/nix/issues/9292.''···# However a simpler alternative still would be [a builtins.gitLsFiles](https://github.com/NixOS/nix/issues/2944).···throw "lib.fileset.${function}: Expected the ${argument} (${toString path}) to point to a local working tree of a Git repository, but it's not."
···lib.fileset.${function}: The ${argument} (${toString path}) is a store path within a working tree of a Git repository.This indicates that a source directory was imported into the store using a method such as `import "''${./.}"` or `path:.`.+This function currently does not support such a use case, since it currently relies on `builtins.fetchGit`.You could make this work by using a fetcher such as `fetchGit` instead of copying the whole repository.If you can't avoid copying the repo to the store, see https://github.com/NixOS/nix/issues/9292.''···# However a simpler alternative still would be [a builtins.gitLsFiles](https://github.com/NixOS/nix/issues/2944).···throw "lib.fileset.${function}: Expected the ${argument} (${toString path}) to point to a local working tree of a Git repository, but it's not."
+3
-3
lib/fileset/tests.sh
+3
-3
lib/fileset/tests.sh
···## But it fails if the path is imported with a fetcher that doesn't remove .git (like just using "${./.}")expectFailure 'import "${./.}" { fs = lib.fileset; }' 'lib.fileset.gitTracked: The argument \(.*\) is a store path within a working tree of a Git repository.[[:blank:]]*This indicates that a source directory was imported into the store using a method such as `import "\$\{./.\}"` or `path:.`.-[[:blank:]]*This function currently does not support such a use case, since it currently relies on `fetchGit`.[[:blank:]]*You could make this work by using a fetcher such as `fetchGit` instead of copying the whole repository.[[:blank:]]*If you can'\''t avoid copying the repo to the store, see https://github.com/NixOS/nix/issues/9292.'···## But it fails if the path is imported with a fetcher that doesn't remove .git (like just using "${./.}")expectFailure 'import "${./.}" { fs = lib.fileset; }' 'lib.fileset.gitTrackedWith: The second argument \(.*\) is a store path within a working tree of a Git repository.[[:blank:]]*This indicates that a source directory was imported into the store using a method such as `import "\$\{./.\}"` or `path:.`.-[[:blank:]]*This function currently does not support such a use case, since it currently relies on `fetchGit`.[[:blank:]]*You could make this work by using a fetcher such as `fetchGit` instead of copying the whole repository.[[:blank:]]*If you can'\''t avoid copying the repo to the store, see https://github.com/NixOS/nix/issues/9292.'expectFailure 'import "${./.}/sub" { fs = lib.fileset; }' 'lib.fileset.gitTracked: The argument \(.*/sub\) is a store path within a working tree of a Git repository.[[:blank:]]*This indicates that a source directory was imported into the store using a method such as `import "\$\{./.\}"` or `path:.`.-[[:blank:]]*This function currently does not support such a use case, since it currently relies on `fetchGit`.[[:blank:]]*You could make this work by using a fetcher such as `fetchGit` instead of copying the whole repository.[[:blank:]]*If you can'\''t avoid copying the repo to the store, see https://github.com/NixOS/nix/issues/9292.'
···## But it fails if the path is imported with a fetcher that doesn't remove .git (like just using "${./.}")expectFailure 'import "${./.}" { fs = lib.fileset; }' 'lib.fileset.gitTracked: The argument \(.*\) is a store path within a working tree of a Git repository.[[:blank:]]*This indicates that a source directory was imported into the store using a method such as `import "\$\{./.\}"` or `path:.`.+[[:blank:]]*This function currently does not support such a use case, since it currently relies on `builtins.fetchGit`.[[:blank:]]*You could make this work by using a fetcher such as `fetchGit` instead of copying the whole repository.[[:blank:]]*If you can'\''t avoid copying the repo to the store, see https://github.com/NixOS/nix/issues/9292.'···## But it fails if the path is imported with a fetcher that doesn't remove .git (like just using "${./.}")expectFailure 'import "${./.}" { fs = lib.fileset; }' 'lib.fileset.gitTrackedWith: The second argument \(.*\) is a store path within a working tree of a Git repository.[[:blank:]]*This indicates that a source directory was imported into the store using a method such as `import "\$\{./.\}"` or `path:.`.+[[:blank:]]*This function currently does not support such a use case, since it currently relies on `builtins.fetchGit`.[[:blank:]]*You could make this work by using a fetcher such as `fetchGit` instead of copying the whole repository.[[:blank:]]*If you can'\''t avoid copying the repo to the store, see https://github.com/NixOS/nix/issues/9292.'expectFailure 'import "${./.}/sub" { fs = lib.fileset; }' 'lib.fileset.gitTracked: The argument \(.*/sub\) is a store path within a working tree of a Git repository.[[:blank:]]*This indicates that a source directory was imported into the store using a method such as `import "\$\{./.\}"` or `path:.`.+[[:blank:]]*This function currently does not support such a use case, since it currently relies on `builtins.fetchGit`.[[:blank:]]*You could make this work by using a fetcher such as `fetchGit` instead of copying the whole repository.[[:blank:]]*If you can'\''t avoid copying the repo to the store, see https://github.com/NixOS/nix/issues/9292.'
+1
-1
lib/path/README.md
+1
-1
lib/path/README.md
···As inputs all three variants are supported for subpaths (and we can't do anything about absolute paths)- (+) `./.` is a valid Nix path expression, although this property does not hold for every relative path or subpath.
···As inputs all three variants are supported for subpaths (and we can't do anything about absolute paths)- (+) `./.` is a valid Nix path expression, although this property does not hold for every relative path or subpath.
+1
-1
lib/tests/misc.nix
+1
-1
lib/tests/misc.nix
···
···