Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
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/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b103b4bc6208
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e7c435cbbdf5
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jul 17, 2020

  1. commitIdFromGitRepo: fix stackoverflow if many branches are used.

    If many branches are created than builtins.match stack overflows because
    of a bug in libstdc++: see NixOS/nix#2147
    
    (cherry picked from commit d7e89fa)
    Mic92 authored and lheckemann committed Jul 17, 2020
    Copy the full SHA
    e7c435c View commit details
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/sources.nix
10 changes: 7 additions & 3 deletions lib/sources.nix
Original file line number Diff line number Diff line change
@@ -148,10 +148,14 @@ rec {
# packed-refs file, so we have to grep through it:
then
let fileContent = readFile packedRefsName;
matchRef = match (".*\n([^\n ]*) " + file + "\n.*") fileContent;
in if matchRef == null
matchRef = builtins.match "([a-z0-9]+) ${file}";
isRef = s: builtins.isString s && (matchRef s) != null;
# there is a bug in libstdc++ leading to stackoverflow for long strings:
# https://github.com/NixOS/nix/issues/2147#issuecomment-659868795
refs = builtins.filter isRef (builtins.split "\n" fileContent);
in if refs == []
then throw ("Could not find " + file + " in " + packedRefsName)
else lib.head matchRef
else lib.head (matchRef (lib.head refs))

else throw ("Not a .git directory: " + path);
in readCommitFromFile "HEAD";