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/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 426e10558d05
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c08cdfa781d6
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jan 24, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    597d6d2 View commit details

Commits on Jun 18, 2019

  1. Merge pull request #54543 from thefloweringash/git-prefetch-errors

    nix-prefetch-git: propagate errors under --quiet
    matthewbauer authored Jun 18, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c08cdfa View commit details
Showing with 32 additions and 15 deletions.
  1. +32 −15 pkgs/build-support/fetchgit/nix-prefetch-git
47 changes: 32 additions & 15 deletions pkgs/build-support/fetchgit/nix-prefetch-git
Original file line number Diff line number Diff line change
@@ -270,7 +270,7 @@ make_deterministic_repo(){
}


_clone_user_rev() {
clone_user_rev() {
local dir="$1"
local url="$2"
local rev="${3:-HEAD}"
@@ -307,19 +307,29 @@ _clone_user_rev() {
fi
}

clone_user_rev() {
if ! test -n "$QUIET"; then
_clone_user_rev "$@"
else
errfile="$(mktemp "${TMPDIR:-/tmp}/git-checkout-err-XXXXXXXX")"
# shellcheck disable=SC2064
trap "rm -rf \"$errfile\"" EXIT
_clone_user_rev "$@" 2> "$errfile" || (
status="$?"
cat "$errfile" >&2
exit "$status"
)
exit_handlers=()

run_exit_handlers() {
exit_status=$?
for handler in "${exit_handlers[@]}"; do
eval "$handler $exit_status"
done
}

trap run_exit_handlers EXIT

quiet_exit_handler() {
exec 2>&3 3>&-
if [ $1 -ne 0 ]; then
cat "$errfile" >&2
fi
rm -f "$errfile"
}

quiet_mode() {
errfile="$(mktemp "${TMPDIR:-/tmp}/git-checkout-err-XXXXXXXX")"
exit_handlers+=(quiet_exit_handler)
exec 3>&2 2>"$errfile"
}

json_escape() {
@@ -362,6 +372,14 @@ EOF
fi
}

remove_tmpPath() {
rm -rf "$tmpPath"
}

if test -n "$QUIET"; then
quiet_mode
fi

if test -z "$branchName"; then
branchName=fetchgit
fi
@@ -390,8 +408,7 @@ else
if test -z "$finalPath"; then

tmpPath="$(mktemp -d "${TMPDIR:-/tmp}/git-checkout-tmp-XXXXXXXX")"
# shellcheck disable=SC2064
trap "rm -rf \"$tmpPath\"" EXIT
exit_handlers+=(remove_tmpPath)

tmpFile="$tmpPath/$(url_to_name "$url" "$rev")"
mkdir -p "$tmpFile"