git-hooks/contrib/libvisio.git/hooks/update | 140 ---------------------------- git-hooks/install | 5 - git-hooks/libvisio.git/hooks/update | 140 ++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+), 141 deletions(-)
New commits: commit fc1c42b44655cd207fc3aa259556181c0f44abd4 Author: Miklos Vajna <[email protected]> Date: Tue Jan 3 09:13:30 2017 +0100 git-hooks: make non-existing repo non-fatal in install Change-Id: Ia622993e091174b8212dc4d65f02dd1332a91389 diff --git a/git-hooks/install b/git-hooks/install index 020d780..96a0f8a 100755 --- a/git-hooks/install +++ b/git-hooks/install @@ -16,7 +16,10 @@ for i in $(find . -name hooks) do for j in $i/* do - [ -e $prefix/$j ] || die "$prefix/$j doesn't exists, remove from repo" + if [ ! -e $prefix/$j ]; then + echo "$prefix/$j doesn't exists, remove from repo" + continue + fi if ! diff -q -u $j $prefix/$j; then if [ ! -w $prefix/$j ]; then echo "$prefix/$j is not writable, skipping" commit b8a1d750f113fcbf49f2e67e4b4d1eab9a1d7c3c Author: Miklos Vajna <[email protected]> Date: Tue Jan 3 09:11:47 2017 +0100 git-hooks: update libvisio path to match reality It has been moved on the fdo mirror. Change-Id: I16b5c428d5dc63ebe5d345621f581f872c668bfa diff --git a/git-hooks/contrib/libvisio.git/hooks/update b/git-hooks/contrib/libvisio.git/hooks/update deleted file mode 100755 index 2966fb8..0000000 --- a/git-hooks/contrib/libvisio.git/hooks/update +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/sh -# -# An example hook script to mail out commit update information. -# It also blocks tags that aren't annotated. -# Called by git-receive-pack with arguments: refname sha1-old sha1-new -# -# To enable this hook: -# (1) change the recipient e-mail address -# (2) make this file executable by "chmod +x update". -# - -# prevent pushing from anyone but the logerrit user -if [ "$(id -u -n )" != "logerrit" ] ; then - echo "*** The reference for this repo is gerrit. do not push directly to fdo" >&2 - exit 1 -fi -from="$(git show -s --pretty=format:'%an <%ae>' $3^{})" - -project=$(cat $GIT_DIR/description) -recipients="[email protected]" - -ref_type=$(git cat-file -t "$3") - -# Avoid re-introducing obsolete tags -if grep -q "^$1$" hooks/obsolete-tags; then - echo "*** Re-introducing an obsolete tag ($1) is not allowed in this repo" >&2 - echo "*** Use corereleasebranches/killtagslocal.sh from contrib/dev-tools.git to get rid of them." >&2 - exit 1 -fi - -# Only allow annotated tags in a shared repo -# Remove this code to treat dumb tags the same as everything else -case "$1","$ref_type" in -refs/tags/*,commit) - echo "*** Un-annotated tags are not allowed in this repo" >&2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." - exit 1;; -refs/tags/*,tag) - echo "### Pushing version '${1##refs/tags/}' to the masses" >&2 - # recipients="[email protected] [email protected]" - ;; -esac - -# set this to 'cat' to get a very detailed listing. -# short only kicks in when an annotated tag is added -short='git shortlog' - -# see 'date --help' for info on how to write this -# The default is a human-readable iso8601-like format with minute -# precision ('2006-01-25 15:58 +0100' for example) -date_format="%F %R %z" - -# Set to the number of pathname components you want in the subject line to -# indicate which components of a project changed. -num_path_components=2 - -# Set subject -repo=$(basename $(cd $GIT_DIR ; pwd)) -if expr "$2" : '0*$' >/dev/null ; then - subject="$repo: Changes to '${1##refs/heads/}'" -else - base=$(git-merge-base "$2" "$3") - subject=$(git-diff-tree -r --name-only "$base" "$3" | - cut -d/ -f-$num_path_components | sort -u | xargs echo -n) - commits=$(git-rev-list "$3" "^$base" | wc -l) - if [ "$commits" -ne 1 ] ; then - subject="$commits commits - $subject" - fi - branch="${1##refs/heads/}" - if [ "$branch" != "master" ] ; then - subject="Branch '$branch' - $subject" - fi - subject="$repo: $subject" -fi - -if expr "$2" : '0*$' >/dev/null -then - # new ref - case "$1" in - refs/tags/*) - # a pushed and annotated tag (usually) means a new version - tag="${1##refs/tags/}" - if [ "$ref_type" = tag ]; then - eval $(git cat-file tag $3 | \ - sed -n '4s/tagger \([^>]*>\)[^0-9]*\([0-9]*\).*/tagger="\1" ts="\2"/p') - date=$(date --date="1970-01-01 00:00:00 $ts seconds" +"$date_format") - echo "Tag '$tag' created by $tagger at $date" - git cat-file tag $3 | sed -n '5,$p' - echo - fi - prev=$(git describe "$3^" | sed 's/-g.*//') - # the first tag in a repo will yield no $prev - if [ -z "$prev" ]; then - echo "Changes since the dawn of time:" - git rev-list --pretty $3 | $short - else - echo "Changes since $prev:" - git rev-list --pretty $prev..$3 | $short - echo --- - git diff $prev..$3 | diffstat -p1 - echo --- - fi - ;; - - refs/heads/*) - branch="${1##refs/heads/}" - echo "New branch '$branch' available with the following commits:" - git-rev-list --pretty "$3" $(git-rev-parse --not --all) - ;; - esac -else - case "$base" in - "$2") - git diff "$3" "^$base" | diffstat -p1 - echo - echo "New commits:" - ;; - *) - echo "Rebased ref, commits from common ancestor:" - ;; - esac - bytes=0 - IFS="$(echo)" - git-rev-list "$3" "^$base" | while read rev; do git-show $rev; done | sed 's#\\#\\\\#g' | - while read line - do - if [ "$bytes" -ge "0" ] ; then - bytes=$(( $bytes + ${#line} + 1 )) - if [ "$bytes" -gt "100000" ] ; then - bytes=-1 - echo -e "\n... etc. - the rest is truncated" - else - echo "$line" - fi - fi - done -fi | -mail -s "$subject" -a "X-Git-Repository: git://anongit.freedesktop.org/git/libreoffice/contrib/libvisio.git" \ - -a "List-Post: <mailto:[email protected]>" -a "From: $from" $recipients -exit 0 diff --git a/git-hooks/libvisio.git/hooks/update b/git-hooks/libvisio.git/hooks/update new file mode 100755 index 0000000..4530762 --- /dev/null +++ b/git-hooks/libvisio.git/hooks/update @@ -0,0 +1,140 @@ +#!/bin/sh +# +# An example hook script to mail out commit update information. +# It also blocks tags that aren't annotated. +# Called by git-receive-pack with arguments: refname sha1-old sha1-new +# +# To enable this hook: +# (1) change the recipient e-mail address +# (2) make this file executable by "chmod +x update". +# + +# prevent pushing from anyone but the logerrit user +if [ "$(id -u -n )" != "logerrit" ] ; then + echo "*** The reference for this repo is gerrit. do not push directly to fdo" >&2 + exit 1 +fi +from="$(git show -s --pretty=format:'%an <%ae>' $3^{})" + +project=$(cat $GIT_DIR/description) +recipients="[email protected]" + +ref_type=$(git cat-file -t "$3") + +# Avoid re-introducing obsolete tags +if grep -q "^$1$" hooks/obsolete-tags; then + echo "*** Re-introducing an obsolete tag ($1) is not allowed in this repo" >&2 + echo "*** Use corereleasebranches/killtagslocal.sh from contrib/dev-tools.git to get rid of them." >&2 + exit 1 +fi + +# Only allow annotated tags in a shared repo +# Remove this code to treat dumb tags the same as everything else +case "$1","$ref_type" in +refs/tags/*,commit) + echo "*** Un-annotated tags are not allowed in this repo" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." + exit 1;; +refs/tags/*,tag) + echo "### Pushing version '${1##refs/tags/}' to the masses" >&2 + # recipients="[email protected] [email protected]" + ;; +esac + +# set this to 'cat' to get a very detailed listing. +# short only kicks in when an annotated tag is added +short='git shortlog' + +# see 'date --help' for info on how to write this +# The default is a human-readable iso8601-like format with minute +# precision ('2006-01-25 15:58 +0100' for example) +date_format="%F %R %z" + +# Set to the number of pathname components you want in the subject line to +# indicate which components of a project changed. +num_path_components=2 + +# Set subject +repo=$(basename $(cd $GIT_DIR ; pwd)) +if expr "$2" : '0*$' >/dev/null ; then + subject="$repo: Changes to '${1##refs/heads/}'" +else + base=$(git-merge-base "$2" "$3") + subject=$(git-diff-tree -r --name-only "$base" "$3" | + cut -d/ -f-$num_path_components | sort -u | xargs echo -n) + commits=$(git-rev-list "$3" "^$base" | wc -l) + if [ "$commits" -ne 1 ] ; then + subject="$commits commits - $subject" + fi + branch="${1##refs/heads/}" + if [ "$branch" != "master" ] ; then + subject="Branch '$branch' - $subject" + fi + subject="$repo: $subject" +fi + +if expr "$2" : '0*$' >/dev/null +then + # new ref + case "$1" in + refs/tags/*) + # a pushed and annotated tag (usually) means a new version + tag="${1##refs/tags/}" + if [ "$ref_type" = tag ]; then + eval $(git cat-file tag $3 | \ + sed -n '4s/tagger \([^>]*>\)[^0-9]*\([0-9]*\).*/tagger="\1" ts="\2"/p') + date=$(date --date="1970-01-01 00:00:00 $ts seconds" +"$date_format") + echo "Tag '$tag' created by $tagger at $date" + git cat-file tag $3 | sed -n '5,$p' + echo + fi + prev=$(git describe "$3^" | sed 's/-g.*//') + # the first tag in a repo will yield no $prev + if [ -z "$prev" ]; then + echo "Changes since the dawn of time:" + git rev-list --pretty $3 | $short + else + echo "Changes since $prev:" + git rev-list --pretty $prev..$3 | $short + echo --- + git diff $prev..$3 | diffstat -p1 + echo --- + fi + ;; + + refs/heads/*) + branch="${1##refs/heads/}" + echo "New branch '$branch' available with the following commits:" + git-rev-list --pretty "$3" $(git-rev-parse --not --all) + ;; + esac +else + case "$base" in + "$2") + git diff "$3" "^$base" | diffstat -p1 + echo + echo "New commits:" + ;; + *) + echo "Rebased ref, commits from common ancestor:" + ;; + esac + bytes=0 + IFS="$(echo)" + git-rev-list "$3" "^$base" | while read rev; do git-show $rev; done | sed 's#\\#\\\\#g' | + while read line + do + if [ "$bytes" -ge "0" ] ; then + bytes=$(( $bytes + ${#line} + 1 )) + if [ "$bytes" -gt "100000" ] ; then + bytes=-1 + echo -e "\n... etc. - the rest is truncated" + else + echo "$line" + fi + fi + done +fi | +mail -s "$subject" -a "X-Git-Repository: git://anongit.freedesktop.org/git/libreoffice/libvisio.git" \ + -a "List-Post: <mailto:[email protected]>" -a "From: $from" $recipients +exit 0 _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
