From: Junio C Hamano Date: Fri, 22 Jan 2010 07:36:31 +0000 (-0800) Subject: Keep track of some hooks used by the primary repository X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0197e2226950f107723575c23fda49cd7e6b9f61;p=thirdparty%2Fgit.git Keep track of some hooks used by the primary repository --- diff --git a/post-applypatch b/post-applypatch new file mode 100755 index 0000000000..a546636098 --- /dev/null +++ b/post-applypatch @@ -0,0 +1,23 @@ +#!/bin/sh + +GIT_DIR=.git +dotest="$GIT_DIR/rebase-apply" + +prec=4 && +this=$(cat 2>/dev/null "$dotest/next") && +msgnum=$(printf "%0${prec}d" $this) && +test -f "$dotest/$msgnum" && +message_id=$(sed -n ' + /^Message-I[Dd]:[ ]*\(<.*>\)[ ]*$/{ + s//\1/p + q + } + /^$/q +' "$dotest/$msgnum") && + +test -n "$message_id" && +head=$(git rev-parse --verify HEAD 2>/dev/null) && + +echo "$head $message_id" >>"$GIT_DIR"/am.log && +GIT_NOTES_REF=refs/notes/amlog \ + git notes edit -m "Message-Id: $message_id" "$head" diff --git a/pre-applypatch b/pre-applypatch new file mode 100755 index 0000000000..217b0b722f --- /dev/null +++ b/pre-applypatch @@ -0,0 +1,32 @@ +#!/bin/sh + +. git-sh-setup + +# Avoid duplicated test numbers --- checking 'pu' is enough +# as we will usually add, but never remove them. +added=$( + git diff-index --cached --name-only --diff-filter=A HEAD -- t | + sed -ne 's|t/\(t[0-9][0-9][0-9][0-9]\)-.*\.sh$|\1|p' +) +if test -n "$added" +then + bad= + exists=$( + git ls-tree --name-only pu:t | + sed -ne 's|^\(t[0-9][0-9][0-9][0-9]\)-.*\.sh$|\1|p' | + tr "\012" " " + ) + for a in $added + do + case " $exists " in + *" $a "*) + echo "Test number $a already taken" + bad=1 + ;; + esac + done + if test -n "$bad" + then + exit 1 + fi +fi