lix/src/libexpr
Maximilian Bosch f742438465
Merge legacy fetchGit-builtin with the generic fetchTree-function
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
2020-07-28 00:44:39 +02:00
..
flake parseFlakeRef(): Only search for the top-level directory for CLI flakerefs 2020-07-17 14:54:21 +02:00
primops Merge legacy fetchGit-builtin with the generic fetchTree-function 2020-07-28 00:44:39 +02:00
attr-path.cc Merge branch 'master' into caveman-LOCs 2020-06-18 13:07:53 -06:00
attr-path.hh Some backports from the flakes branch 2020-06-18 14:03:00 +02:00
attr-set.cc EvalState::allocAttr(): Add convenience method 2020-03-24 13:26:37 +01:00
attr-set.hh use plain errPos instead of nixCode; fix tests 2020-06-23 15:30:13 -06:00
common-eval-args.cc Remove TreeInfo 2020-05-30 00:44:11 +02:00
common-eval-args.hh Fix --override-flake and add a test 2020-01-22 20:00:58 +01:00
eval-cache.cc Merge remote-tracking branch 'upstream/master' into hash-always-has-type 2020-07-16 14:58:53 +00:00
eval-cache.hh Merge remote-tracking branch 'upstream/master' into hash-always-has-type 2020-07-16 14:58:53 +00:00
eval-inline.hh use plain errPos instead of nixCode; fix tests 2020-06-23 15:30:13 -06:00
eval.cc Merge remote-tracking branch 'origin/master' into flakes 2020-07-14 13:56:18 +02:00
eval.hh Merge remote-tracking branch 'origin/master' into flakes 2020-07-06 16:40:10 +02:00
function-trace.cc Revert the enum struct change 2020-06-18 22:11:26 +00:00
function-trace.hh Hide FunctionCallTrace constructor/destructor 2020-01-05 16:21:34 +01:00
get-drvs.cc Only store hash of fixed derivation output 2020-07-08 19:11:39 -04:00
get-drvs.hh experimental/optional -> optional 2019-03-14 14:10:52 +01:00
imported-drv-to-derivation.nix Move some corepkgs into the nix binary 2020-03-11 16:57:48 +01:00
json-to-value.cc JSONSax: Use a RootValue 2020-04-16 17:30:18 +02:00
json-to-value.hh Fix extra ; warnings involving MakeError 2019-11-10 11:24:47 -05:00
lexer.l Remove trailing whitespace 2020-06-15 14:12:39 +02:00
local.mk Merge remote-tracking branch 'origin/master' into flakes 2020-06-17 10:26:52 +02:00
nix-expr.pc.in pkg-config files: Use c++17 2019-03-14 14:11:12 +01:00
nixexpr.cc comments and cleanup 2020-06-30 16:31:55 -06:00
nixexpr.hh use plain errPos instead of nixCode; fix tests 2020-06-23 15:30:13 -06:00
parser.y Merge remote-tracking branch 'origin/master' into flakes 2020-07-06 16:40:10 +02:00
primops.cc Merge remote-tracking branch 'upstream/master' into hash-always-has-type 2020-07-27 16:13:57 +00:00
primops.hh Don't provide 'getFlake' if the 'flakes' feature is not enabled 2020-06-18 14:03:00 +02:00
symbol-table.hh nix flake show: Use evaluation cache 2020-04-17 01:02:29 +02:00
value-to-json.cc remove 'format' from Error constructor calls 2020-04-21 17:07:07 -06:00
value-to-json.hh nix path-info: Add --json flag 2016-08-29 17:29:24 +02:00
value-to-xml.cc OCD performance fix: {find,count}+insert => insert 2019-10-09 16:06:29 +02:00
value-to-xml.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
value.hh EvalCache: Store string contexts 2020-06-29 19:08:37 +02:00