forked from lix-project/lix
Maximilian Bosch
f742438465
The original idea was to implement a git-fetcher in Nix's core that supports content hashes[1]. In #3549[2] it has been suggested to actually use `fetchTree` for this since it's a fairly generic wrapper over the new fetcher-API[3] and already supports content-hashes. This patch implements a new git-fetcher based on `fetchTree` by incorporating the following changes: * Removed the original `fetchGit`-implementation and replaced it with an alias on the `fetchTree` implementation. * Ensured that the `git`-fetcher from `libfetchers` always computes a content-hash and returns an "empty" revision on dirty trees (the latter one is needed to retain backwards-compatibility). * The hash-mismatch error in the fetcher-API exits with code 102 as it usually happens whenever a hash-mismatch is detected by Nix. * Removed the `flakes`-feature-flag: I didn't see a reason why this API is so tightly coupled to the flakes-API and at least `fetchGit` should remain usable without any feature-flags. * It's only possible to specify a `narHash` for a `git`-tree if either a `ref` or a `rev` is given[4]. * It's now possible to specify an URL without a protocol. If it's missing, `file://` is automatically added as it was the case in the original `fetchGit`-implementation. [1] https://github.com/NixOS/nix/pull/3216 [2] https://github.com/NixOS/nix/pull/3549#issuecomment-625194383 [3] https://github.com/NixOS/nix/pull/3459 [4] https://github.com/NixOS/nix/pull/3216#issuecomment-553956703 |
||
---|---|---|
.. | ||
config | ||
lang | ||
plugins | ||
add.sh | ||
bad.tar.xz | ||
binary-cache.sh | ||
brotli.sh | ||
build-dry.sh | ||
build-hook.nix | ||
build-remote.sh | ||
case-hack.sh | ||
case.nar | ||
check-refs.nix | ||
check-refs.sh | ||
check-reqs.nix | ||
check-reqs.sh | ||
check.nix | ||
check.sh | ||
common.sh.in | ||
config.nix.in | ||
config.sh | ||
dependencies.builder0.sh | ||
dependencies.nix | ||
dependencies.sh | ||
dump-db.sh | ||
export-graph.nix | ||
export-graph.sh | ||
export.sh | ||
fetchGit.sh | ||
fetchGitRefs.sh | ||
fetchGitSubmodules.sh | ||
fetchMercurial.sh | ||
fetchurl.sh | ||
filter-source.nix | ||
filter-source.sh | ||
fixed.builder1.sh | ||
fixed.builder2.sh | ||
fixed.nix | ||
fixed.sh | ||
flakes.sh | ||
function-trace.sh | ||
gc-auto.sh | ||
gc-concurrent.builder.sh | ||
gc-concurrent.nix | ||
gc-concurrent.sh | ||
gc-concurrent2.builder.sh | ||
gc-runtime.nix | ||
gc-runtime.sh | ||
gc.sh | ||
github-flakes.nix | ||
hash-check.nix | ||
hash.sh | ||
import-derivation.nix | ||
import-derivation.sh | ||
init.sh | ||
install-darwin.sh | ||
lang.sh | ||
linux-sandbox.sh | ||
local-store.sh | ||
local.mk | ||
logging.sh | ||
misc.sh | ||
multiple-outputs.nix | ||
multiple-outputs.sh | ||
nar-access.nix | ||
nar-access.sh | ||
nix-build.sh | ||
nix-channel.sh | ||
nix-copy-closure.nix | ||
nix-copy-ssh.sh | ||
nix-profile.sh | ||
nix-shell.sh | ||
optimise-store.sh | ||
parallel.builder.sh | ||
parallel.nix | ||
parallel.sh | ||
pass-as-file.sh | ||
placeholders.sh | ||
plugins.sh | ||
post-hook.sh | ||
pure-eval.nix | ||
pure-eval.sh | ||
push-to-store.sh | ||
recursive.sh | ||
referrers.sh | ||
remote-builds.nix | ||
remote-store.sh | ||
repair.sh | ||
restricted.nix | ||
restricted.sh | ||
search.nix | ||
search.sh | ||
secure-drv-outputs.nix | ||
secure-drv-outputs.sh | ||
setuid.nix | ||
shell-hello.nix | ||
shell.nix | ||
shell.sh | ||
shell.shebang.rb | ||
shell.shebang.sh | ||
signing.sh | ||
simple.builder.sh | ||
simple.nix | ||
simple.sh | ||
structured-attrs.nix | ||
structured-attrs.sh | ||
tarball.sh | ||
timeout.nix | ||
timeout.sh | ||
user-envs.builder.sh | ||
user-envs.nix | ||
user-envs.sh |