Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
base: 7c097275c486
Choose a base ref
...
head repository: NixOS/nix
compare: 39311e7009a2
Choose a head ref
  • 3 commits
  • 6 files changed
  • 2 contributors

Commits on Jul 27, 2020

  1. 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] #3216
    [2] #3549 (comment)
    [3] #3459
    [4] #3216 (comment)
    Ma27 committed Jul 27, 2020
    Copy the full SHA
    f742438 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2020

  1. Restore backwards-compat for current builtins.fetchGit

    If a repo is dirty, it used to return a `rev` object with an "empty"
    sha1 (0000000000000000000000000000000000000000). Please note that this
    only applies for `builtins.fetchGit` and *not* for `builtins.fetchTree{
    type = "git"; }`.
    Ma27 committed Jul 28, 2020
    Copy the full SHA
    e4940e9 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2020

  1. Merge pull request #3549 from Ma27/fetchgit-hash

    Merge legacy `fetchGit`-builtin with the generic `fetchTree`-function
    edolstra committed Jul 29, 2020
    Copy the full SHA
    39311e7 View commit details
    Browse the repository at this point in the history