]> snippets.scripts.mit.edu Git - Scripts/git/.git/blame - svn-hooks/commit-zephyr
kdo: Upstream krb5 now supports kswitch
[Scripts/git/.git] / svn-hooks / commit-zephyr
CommitLineData
2bc10a4a 1#!/bin/bash
b4a486e4
GT
2#
3# This is a script that can be called from a Subversion post-commit hook
4# to zephyr a summary of the commit or the full commit.
5#
6# Use by putting something like the following in hooks/post-commit:
7# REPOS="$1"
8# REV="$2"
9# /mit/snippets/svn-hooks/commit-zephyr "$REPOS" "$REV" -c scripts
10# /mit/snippets/svn-hooks/commit-zephyr "$REPOS" "$REV" --full -c scripts-auto -i commits
2bc10a4a 11
3d8ed419
AK
12export LC_ALL=en_US.UTF-8
13
2bc10a4a
GT
14CLASS=test
15INSTANCE=@
16FULL=0
17
18OPTS=$(getopt -o c:i:f -l class:,instance:,full -n "$0" -- "$@") || exit $?
19eval set -- "$OPTS"
20while :; do
21 case "$1" in
22 -c|--class) CLASS=$2; shift 2;;
23 -i|--instance) INSTANCE=$2; shift 2;;
24 -f|--full) FULL=1; shift;;
25 --) shift; break;;
26 *) exit 1;;
27 esac
28done
29[ $# -ge 2 ] || exit 1
30REPOS=$1
31REV=$2
32
33if [ "$INSTANCE" = "${INSTANCE%@}@" ]; then
34 INSTANCE=${INSTANCE%@}r$REV
35fi
36
37dirs=$(svnlook dirs-changed "$REPOS" -r "$REV")
38svnlook info "$REPOS" -r "$REV" | (
39 read -r author
40 read -r datestamp
41 read -r logsize
42 log=$(cat)
43 echo "r$REV by $author $datestamp"
44 echo "$log"
45 svnlook changed "$REPOS" -r "$REV"
46 if [ "$FULL" -eq 1 ]; then
47 echo
48 svnlook diff "$REPOS" -r "$REV"
49 else
50 echo svnlook diff "$REPOS" -r "$REV"
51 fi
f208ccb4 52) | zwrite -d -c "$CLASS" -i "$INSTANCE" -O "auto" -s "SVN: r$REV"