From: Ansgar Burchardt Date: Tue, 17 Jun 2014 17:46:31 +0000 (+0100) Subject: Rename git-whitespace-hook to dune-git-whitespace-hook. X-Git-Tag: archive/raspbian/2.7.1-2+rpi1~1^2^2^2^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b7d98806feb8df544705a98bea4278a022525c2e;p=dune-common.git Rename git-whitespace-hook to dune-git-whitespace-hook. The name git-whitespace-hook is a bit too generic for a DUNE-specific tool. Gbp-Pq: Name rename-git-whitespace-hook.patch --- diff --git a/bin/dunecontrol b/bin/dunecontrol index f4b02f3..4ee4a67 100755 --- a/bin/dunecontrol +++ b/bin/dunecontrol @@ -461,17 +461,28 @@ run_default_vcsetup() { fi else # standard handling of Git whitespace hook + for f in dune-git-whitespace-hook git-whitespace-hook; do + f="${PREFIX_DIR}/bin/${f}" + if [ -e "${f}" ]; then + git_whitespace_hook="${f}" + break + fi + done + if [ -z "${git_whitespace_hook:-}" ]; then + echo "Did not find git-whitespace-hook." >&2 + exit 1 + fi if [ ! -e "$GITHOOKPATH" ]; then # there is no hook yet, we can safely install ours echo "--> Installing Git pre-commit hook to enforce whitespace policy" - cp -p "$PREFIX_DIR/bin/git-whitespace-hook" "$GITHOOKPATH" + cp -p "${git_whitespace_hook}" "$GITHOOKPATH" else # there is already a hook, check whether it is our whitespace hook local HOOKTAG="$(eval head -n 2 \"$GITHOOKPATH\" | tail -n 1)" if [ "x$HOOKTAG" = "x# dune-git-whitespace-hook" ]; then - if [ "$PREFIX_DIR/bin/git-whitespace-hook" -nt "$GITHOOKPATH" ]; then + if [ "${git_whitespace_hook}" -nt "$GITHOOKPATH" ]; then echo "--> Updating Git pre-commit hook with newer version" - cp -p "$PREFIX_DIR/bin/git-whitespace-hook" "$GITHOOKPATH" + cp -p "${git_whitespace_hook}" "$GITHOOKPATH" fi else echo "WARNING: Existing pre-commit hook found!"