lix/src
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
..
build-remote Revert the enum struct change 2020-06-18 22:11:26 +00:00
cpptoml Revert the enum struct change 2020-06-18 22:11:26 +00:00
libexpr Merge legacy fetchGit-builtin with the generic fetchTree-function 2020-07-28 00:44:39 +02:00
libfetchers Merge legacy fetchGit-builtin with the generic fetchTree-function 2020-07-28 00:44:39 +02:00
libmain Merge remote-tracking branch 'origin/master' into flakes 2020-07-06 16:40:10 +02:00
libstore Merge remote-tracking branch 'upstream/master' into hash-always-has-type 2020-07-27 16:13:57 +00:00
libutil Merge remote-tracking branch 'upstream/master' into hash-always-has-type 2020-07-27 14:22:45 +00:00
nix Merge remote-tracking branch 'upstream/master' into hash-always-has-type 2020-07-27 16:13:57 +00:00
nix-build appended ' __attribute__((weak)); ' to 'extern char * * environ ' 2020-06-17 03:25:34 +01:00
nix-channel Merge branch 'master' into errors-phase-2 2020-05-11 14:35:30 -06:00
nix-collect-garbage Remove global -I flags 2020-03-30 15:30:19 +02:00
nix-copy-closure Revert the enum struct change 2020-06-18 22:11:26 +00:00
nix-daemon Remove trailing whitespace 2020-06-15 14:12:39 +02:00
nix-env Get rid of basicDerivation::findOutput 2020-07-23 14:39:02 +00:00
nix-instantiate remove 'format' from Error constructor calls 2020-04-21 17:07:07 -06:00
nix-prefetch-url Merge remote-tracking branch 'upstream/master' into hash-always-has-type 2020-07-13 03:01:44 +00:00
nix-store Merge remote-tracking branch 'upstream/master' into hash-always-has-type 2020-07-27 16:13:57 +00:00
resolve-system-dependencies StorePath: Rewrite in C++ 2020-06-16 14:28:41 +02:00