@leroysheep / rag-system / commits / 0197e22269

Keep track of some hooks used by the primary repository

Junio C Hamano committed Jan 21, 2010 at 23:36 UTC 0197e2226950f107723575c23fda49cd7e6b9f61
2 files changed +55
post-applypatch
+23
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"
pre-applypatch
+32
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