The branch, master has been updated
via cfb315dbe5e144ed3b2bebb5a749db9143205366 (commit)
from a68a677c164fbf145e580e7ce7719004db67883b (commit)
- Log -----------------------------------------------------------------
commit cfb315dbe5e144ed3b2bebb5a749db9143205366
Author: Michal Čihař <michal(a)cihar.com>
Date: Thu Feb 25 17:24:40 2010 +0100
Put module to CIA.vc.
-----------------------------------------------------------------------
Summary of changes:
git-hooks/git-ciabot | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/git-hooks/git-ciabot b/git-hooks/git-ciabot
index 522031a..dd81b63 100755
--- a/git-hooks/git-ciabot
+++ b/git-hooks/git-ciabot
@@ -23,6 +23,7 @@
# The project as known to CIA
project="$(git config hooks.cia-project)"
+module=`basename $PWD`
# Set to true if you want the full log to be sent
noisy=false
@@ -34,7 +35,7 @@ to="cia(a)cia.vc"
sendmail="/usr/sbin/sendmail -t"
# Changeset URL
-url="http://phpmyadmin.git.sourceforge.net/git/gitweb.cgi?p=phpmyadmin/`basename $PWD`;a=commit;h=@@sha1@@"
+url="http://phpmyadmin.git.sourceforge.net/git/gitweb.cgi?p=phpmyadmin/$module;a…"
# You shouldn't be touching anything else.
if [[ $# = 0 ]] ; then
@@ -76,6 +77,7 @@ out="
</generator>
<source>
<project>${project}</project>
+ <module>${module}</module>
<branch>${refname}</branch>
</source>
<timestamp>${ts}</timestamp>
hooks/post-receive
--
phpMyAdmin scripts
The branch, master has been updated
via a68a677c164fbf145e580e7ce7719004db67883b (commit)
via c528db5e5b95a5369a0af47481491a13999c71bc (commit)
from 1a5e64308d67d5f26cc2ea0497134ac7fe1033ed (commit)
- Log -----------------------------------------------------------------
commit a68a677c164fbf145e580e7ce7719004db67883b
Author: Michal Čihař <michal(a)cihar.com>
Date: Thu Feb 25 17:20:45 2010 +0100
Drop not used ciabot.
commit c528db5e5b95a5369a0af47481491a13999c71bc
Author: Michal Čihař <michal(a)cihar.com>
Date: Thu Feb 25 17:19:27 2010 +0100
Oops, this wants different order of args.
-----------------------------------------------------------------------
Summary of changes:
git-hooks/git-ciabot.pl | 308 -----------------------------------------------
git-hooks/post-receive | 2 +-
2 files changed, 1 insertions(+), 309 deletions(-)
delete mode 100755 git-hooks/git-ciabot.pl
diff --git a/git-hooks/git-ciabot.pl b/git-hooks/git-ciabot.pl
deleted file mode 100755
index 19eea54..0000000
--- a/git-hooks/git-ciabot.pl
+++ /dev/null
@@ -1,308 +0,0 @@
-#!/usr/bin/perl -w
-#
-# ciabot -- Mail a git log message to a given address, for the purposes of CIA
-#
-# Loosely based on cvslog by Russ Allbery <rra(a)stanford.edu>
-# Copyright 1998 Board of Trustees, Leland Stanford Jr. University
-#
-# Copyright 2001, 2003, 2004, 2005 Petr Baudis <pasky(a)ucw.cz>
-#
-# This program is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License version 2, as published by the
-# Free Software Foundation.
-#
-# The master location of this file is in the Cogito repository
-# (see http://www.kernel.org/git/).
-#
-# This program is designed to run as the .git/hooks/post-commit hook. It takes
-# the commit information, massages it and mails it to the address given below.
-#
-# The calling convention of the post-commit hook is:
-#
-# .git/hooks/post-commit $commit_sha1 $branch_name
-#
-# If it does not work, try to disable $xml_rpc in the configuration section
-# below. Also, remember to make the hook file executable.
-#
-#
-# Note that you can (and it might be actually more desirable) also use this
-# script as the GIT update hook:
-#
-# refname=${1#refs/heads/}
-# [ "$refname" = "master" ] && refname=
-# oldhead=$2
-# newhead=$3
-# for merged in $(git rev-list $newhead ^$oldhead | tac); do
-# /path/to/ciabot.pl $merged $refname
-# done
-#
-# This is useful when you use a remote repository that you only push to. The
-# update hook will be triggered each time you push into that repository, and
-# the pushed commits will be reported through CIA.
-
-use strict;
-use vars qw ($project $module $from_email $dest_email $noisy $rpc_uri $sendmail
- $xml_rpc $ignore_regexp $alt_local_message_target);
-
-### Configuration
-
-# Project name (as known to CIA).
-$project = `git config hooks.cia-project`;
-chomp($project);
-die "$0: hooks.cia_project not set in config file" unless $project;
-
-# Module name
-$module = `git config hooks.cia-module`;
-chomp($module);
-unless ($module) {
- my ($git_dir) = `git rev-parse --git-dir`;
- chomp($git_dir);
- if ($git_dir eq ".") {
- $git_dir = `pwd`;
- chomp($git_dir);
- }
- $git_dir = `basename $git_dir`;
- chomp($git_dir);
- $git_dir =~ s/.git$//;
- $module = $git_dir;
-}
-
-# The from address in generated mails.
-$from_email = 'michal(a)cihar.com';
-
-# Mail all reports to this address.
-$dest_email = 'cia(a)cia.vc';
-
-# If using XML-RPC, connect to this URI
-$rpc_uri = `git config hooks.cia-rpc-uri`;
-chomp($rpc_uri);
-$rpc_uri = 'http://cia.vc/RPC2' unless $rpc_uri;
-
-# Path to your USCD sendmail compatible binary (your mailer daemon created this
-# program somewhere).
-$sendmail = '/usr/sbin/sendmail';
-
-# If set, the script will send CIA the full commit message. If unset, only the
-# first line of the commit message will be sent.
-$noisy = 1;
-
-# This script can communicate with CIA either by mail or by an XML-RPC
-# interface. The XML-RPC interface is faster and more efficient, however you
-# need to have RPC::XML perl module installed, and some large CVS hosting sites
-# (like Savannah or Sourceforge) might not allow outgoing HTTP connections
-# while they allow outgoing mail. Also, this script will hang and eventually
-# not deliver the event at all if CIA server happens to be down, which is
-# unfortunately not an uncommon condition.
-$xml_rpc = `git config hooks.cia-use-rpc`;
-chomp($xml_rpc);
-$xml_rpc = 0 unless $xml_rpc;
-
-# This variable should contain a regexp, against which each file will be
-# checked, and if the regexp is matched, the file is ignored. This can be
-# useful if you do not want auto-updated files, such as e.g. ChangeLog, to
-# appear via CIA.
-#
-# The following example will make the script ignore all changes in two specific
-# files in two different modules, and everything concerning module 'admin':
-#
-# $ignore_regexp = "^(gentoo/Manifest|elinks/src/bfu/inphist.c|admin/)";
-$ignore_regexp = "";
-
-# It can be useful to also grab the generated XML message by some other
-# programs and e.g. autogenerate some content based on it. Here you can specify
-# a file to which it will be appended.
-$alt_local_message_target = "";
-
-
-
-
-### The code itself
-
-use vars qw ($commit $tree @parent $author $committer);
-use vars qw ($user $branch $rev @files $logmsg $message);
-my $line;
-
-
-
-### Input data loading
-
-
-# The commit stuff
-$commit = $ARGV[0];
-$branch = $ARGV[1];
-
-open COMMIT, "git cat-file commit $commit|" or die "$0: git cat-file commit $commit: $!";
-my $state = 0;
-$logmsg = '';
-while (defined ($line = <COMMIT>)) {
- if ($state == 1) {
- $logmsg .= $line;
- $noisy or $state++;
- next;
- } elsif ($state > 1) {
- next;
- }
-
- chomp $line;
- unless ($line) {
- $state = 1;
- next;
- }
-
- my ($key, $value) = split(/ /, $line, 2);
- if ($key eq 'tree') {
- $tree = $value;
- } elsif ($key eq 'parent') {
- push(@parent, $value);
- } elsif ($key eq 'author') {
- $author = $value;
- } elsif ($key eq 'committer') {
- $committer = $value;
- }
-}
-close COMMIT;
-
-
-open DIFF, "git diff-tree -r $parent[0] $tree|" or die "$0: git diff-tree $parent[0] $tree: $!";
-while (defined ($line = <DIFF>)) {
- chomp $line;
- my @f;
- (undef, @f) = split(/\t/, $line, 2);
- push (@files, @f);
-}
-close DIFF;
-
-
-# Figure out who is doing the update.
-# XXX: Too trivial this way?
-($user) = $author =~ /<(.*@.*?)>/;
-
-
-$rev = substr($commit, 0, 7);
-
-
-
-
-### Remove to-be-ignored files
-
-@files = grep { $_ !~ m/$ignore_regexp/; } @files
- if ($ignore_regexp);
-exit unless @files;
-
-
-
-### Compose the mail message
-
-
-my ($VERSION) = '1.0+alioth1';
-my $ts = time;
-
-$message = <<EM
-<message>
- <generator>
- <name>CIA Perl client for Git</name>
- <version>$VERSION</version>
- </generator>
- <source>
- <project>$project</project>
-EM
-;
-$message .= " <module>$module</module>" if ($module);
-$message .= " <branch>$branch</branch>" if ($branch);
-$message .= <<EM
- </source>
- <timestamp>
- $ts
- </timestamp>
- <body>
- <commit>
- <author>$user</author>
- <revision>$rev</revision>
- <files>
-EM
-;
-
-foreach (@files) {
- s/&/&/g;
- s/</</g;
- s/>/>/g;
- $message .= " <file>$_</file>\n";
-}
-
-$logmsg =~ s/&/&/g;
-$logmsg =~ s/</</g;
-$logmsg =~ s/>/>/g;
-
-$message .= <<EM
- </files>
- <log>
-$logmsg
- </log>
- </commit>
- </body>
-</message>
-EM
-;
-
-
-
-### Write the message to an alt-target
-
-if ($alt_local_message_target and open (ALT, ">>$alt_local_message_target")) {
- print ALT $message;
- close ALT;
-}
-
-
-
-### Send out the XML-RPC message
-
-if ($xml_rpc) {
- # We gotta be careful from now on. We silence all the warnings because
- # RPC::XML code is crappy and works with undefs etc.
- $^W = 0;
- $RPC::XML::ERROR if (0); # silence perl's compile-time warning
-
- require RPC::XML;
- require RPC::XML::Client;
-
- my $rpc_client = new RPC::XML::Client $rpc_uri;
- my $rpc_request = RPC::XML::request->new('hub.deliver', $message);
- my $rpc_response = $rpc_client->send_request($rpc_request);
-
- unless (ref $rpc_response) {
- die "$0: XML-RPC Error: $RPC::XML::ERROR\n";
- }
- exit;
-}
-
-
-
-### Send out the mail
-
-
-# Open our mail program
-
-open (MAIL, "| $sendmail -t -oi -oem") or die "$0: Cannot execute $sendmail : " . ($?>>8);
-
-
-# The mail header
-
-print MAIL <<EOM;
-From: $from_email
-To: $dest_email
-Content-type: text/xml
-Subject: DeliverXML
-
-EOM
-
-print MAIL $message;
-
-
-# Close the mail
-
-close MAIL;
-die "$0: sendmail exit status " . ($? >> 8) . "\n" unless ($? == 0);
-
-
-# vi: set sw=2:
diff --git a/git-hooks/post-receive b/git-hooks/post-receive
index f71b8fd..58d6998 100755
--- a/git-hooks/post-receive
+++ b/git-hooks/post-receive
@@ -687,7 +687,7 @@ else
generate_email $oldrev $newrev $refname | send_mail
if [ -n "$cia_project" ]; then
for merged in $(git-rev-list $newrev ^$oldrev | tac); do
- /gitrepo/p/ph/phpmyadmin/scripts/hooks/git-ciabot $merged $refname
+ /gitrepo/p/ph/phpmyadmin/scripts/hooks/git-ciabot $refname $merged
done
fi
done
hooks/post-receive
--
phpMyAdmin scripts
The branch, master has been updated
via 5043584361445bd86ec5c43f8d6925b222fbe9bd (commit)
from e6796538aab188515753c63e544157177651e823 (commit)
- Log -----------------------------------------------------------------
commit 5043584361445bd86ec5c43f8d6925b222fbe9bd
Author: Michal Čihař <michal(a)cihar.com>
Date: Thu Feb 25 17:16:39 2010 +0100
Avoid using repo-config.
-----------------------------------------------------------------------
Summary of changes:
git-hooks/git-ciabot | 2 +-
git-hooks/post-receive | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-hooks/git-ciabot b/git-hooks/git-ciabot
index 1fb1b37..8367301 100755
--- a/git-hooks/git-ciabot
+++ b/git-hooks/git-ciabot
@@ -22,7 +22,7 @@
#
# The project as known to CIA
-project="$(git repo-config hooks.cia-project)"
+project="$(git config hooks.cia-project)"
# Set to true if you want the full log to be sent
noisy=false
diff --git a/git-hooks/post-receive b/git-hooks/post-receive
index e83343f..f71b8fd 100755
--- a/git-hooks/post-receive
+++ b/git-hooks/post-receive
@@ -671,7 +671,7 @@ announcerecipients=$(git config hooks.announcelist)
envelopesender=$(git config hooks.envelopesender)
emailprefix=$(git config hooks.emailprefix || echo '[SCM] ')
custom_showrev=$(git config hooks.showrev)
-cia_project=$(git repo-config hooks.cia-project)
+cia_project=$(git config hooks.cia-project)
# --- Main loop
# Allow dual mode: run from the command line just like the update hook, or
hooks/post-receive
--
phpMyAdmin scripts
The branch, master has been updated
via e6796538aab188515753c63e544157177651e823 (commit)
via 3272c3d9c0336660f7a922f40e03f51e58894472 (commit)
via 7b2513d0877cb02d17fba7a3782fd9b8104d52e8 (commit)
via ed4f19cbcc44d2bd5607d1639e1b90c902c229bb (commit)
via 12cb553fc77138f3405d6c0befb7df9a8eab0e91 (commit)
from 02593571f4d0448d24024d62c73cb022f36c2078 (commit)
- Log -----------------------------------------------------------------
commit e6796538aab188515753c63e544157177651e823
Author: Michal Čihař <michal(a)cihar.com>
Date: Thu Feb 25 17:14:41 2010 +0100
Fix viewer url.
commit 3272c3d9c0336660f7a922f40e03f51e58894472
Author: Michal Čihař <michal(a)cihar.com>
Date: Thu Feb 25 17:13:43 2010 +0100
Adjust config.
commit 7b2513d0877cb02d17fba7a3782fd9b8104d52e8
Author: Michal Čihař <michal(a)cihar.com>
Date: Thu Feb 25 17:13:33 2010 +0100
Call new bot.
commit ed4f19cbcc44d2bd5607d1639e1b90c902c229bb
Author: Michal Čihař <michal(a)cihar.com>
Date: Thu Feb 25 17:12:05 2010 +0100
Add another ciabot.
This one seems to better fit our needs.
commit 12cb553fc77138f3405d6c0befb7df9a8eab0e91
Author: Michal Čihař <michal(a)cihar.com>
Date: Thu Feb 25 17:08:05 2010 +0100
CIA notification per commit.
-----------------------------------------------------------------------
Summary of changes:
git-hooks/git-ciabot | 109 ++++++++++++++++++++++++++++++++++++++++++++++++
git-hooks/post-receive | 4 +-
2 files changed, 112 insertions(+), 1 deletions(-)
create mode 100755 git-hooks/git-ciabot
diff --git a/git-hooks/git-ciabot b/git-hooks/git-ciabot
new file mode 100755
index 0000000..1fb1b37
--- /dev/null
+++ b/git-hooks/git-ciabot
@@ -0,0 +1,109 @@
+#!/usr/bin/env bash
+# Distributed under the terms of the GNU General Public License v2
+# Copyright (c) 2006 Fernando J. Pereda <ferdy(a)gentoo.org>
+#
+# Git CIA bot in bash. (no, not the POSIX shell, bash).
+# It is *heavily* based on Git ciabot.pl by Petr Baudis.
+#
+# It is meant to be run either on a post-commit hook or in an update
+# hook:
+#
+# post-commit: It parses latest commit and current HEAD to get the
+# information it needs.
+#
+# update: You have to call it once per merged commit:
+#
+# refname=$1
+# oldhead=$2
+# newhead=$3
+# for merged in $(git rev-list ${oldhead}..${newhead} | tac) ; do
+# /path/to/ciabot.bash ${refname} ${merged}
+# done
+#
+
+# The project as known to CIA
+project="$(git repo-config hooks.cia-project)"
+
+# Set to true if you want the full log to be sent
+noisy=false
+
+# Addresses for the e-mail
+from="you(a)yourthing.com"
+to="cia(a)cia.vc"
+
+# SMTP client to use
+sendmail="/usr/sbin/sendmail -t"
+
+# Changeset URL
+url="http://phpmyadmin.git.sourceforge.net/git/gitweb.cgi?p=phpmyadmin/`basename $PWD`;a=commit;h=@@sha1@@"
+
+# You shouldn't be touching anything else.
+if [[ $# = 0 ]] ; then
+ refname=$(git symbolic-ref HEAD 2>/dev/null)
+ merged=$(git rev-parse HEAD)
+else
+ refname=$1
+ merged=$2
+fi
+
+refname=${refname##refs/heads/}
+
+gitver=$(git --version)
+gitver=${gitver##* }
+
+rev=$(git describe ${merged} 2>/dev/null)
+[[ -z ${rev} ]] && rev=${merged:0:12}
+
+rawcommit=$(git cat-file commit ${merged})
+
+author=$(sed -n -e '/^author .*<\([^(a)]*\).*$/s--\1-p' \
+ <<< "${rawcommit}")
+
+logmessage=$(sed -e '1,/^$/d' <<< "${rawcommit}")
+${noisy} || logmessage=$(head -n 1 <<< "${logmessage}")
+logmessage=${logmessage//&/&}
+logmessage=${logmessage//</<}
+logmessage=${logmessage//>/>}
+
+ts=$(sed -n -e '/^author .*> \([0-9]\+\).*$/s--\1-p' \
+ <<< "${rawcommit}")
+
+out="
+<message>
+ <generator>
+ <name>CIA Bash client for Git</name>
+ <version>${gitver}</version>
+ <url>http://dev.gentoo.org/~ferdy/stuff/ciabot.bash</url>
+ </generator>
+ <source>
+ <project>${project}</project>
+ <branch>${refname}</branch>
+ </source>
+ <timestamp>${ts}</timestamp>
+ <body>
+ <commit>
+ <author>${author}</author>
+ <revision>${rev}</revision>
+ <files>
+ $(git diff-tree -r --name-only ${merged} |
+ sed -e '1d' -e 's-.*-<file>&</file>-')
+ </files>
+ <log>
+${logmessage}
+ </log>
+ <url>${url//@@sha1@@/${merged}}</url>
+ </commit>
+ </body>
+</message>"
+
+${sendmail} << EOM
+Message-ID: <${merged:0:12}.${author}@${project}>
+From: ${from}
+To: ${to}
+Content-type: text/xml
+Subject: DeliverXML
+${out}
+EOM
+
+# vim: set tw=70 :
+
diff --git a/git-hooks/post-receive b/git-hooks/post-receive
index 34dcf4b..e83343f 100755
--- a/git-hooks/post-receive
+++ b/git-hooks/post-receive
@@ -686,7 +686,9 @@ else
do
generate_email $oldrev $newrev $refname | send_mail
if [ -n "$cia_project" ]; then
- /gitrepo/p/ph/phpmyadmin/scripts/hooks/git-ciabot.pl $newrev $refname
+ for merged in $(git-rev-list $newrev ^$oldrev | tac); do
+ /gitrepo/p/ph/phpmyadmin/scripts/hooks/git-ciabot $merged $refname
+ done
fi
done
fi
hooks/post-receive
--
phpMyAdmin scripts
The branch, master has been updated
via 02593571f4d0448d24024d62c73cb022f36c2078 (commit)
via def1b959efa2e14bb2d27cd71a1d01d341a1d7cc (commit)
from 8198049d1d02fd73e2449630c2d2153e0cad69d6 (commit)
- Log -----------------------------------------------------------------
commit 02593571f4d0448d24024d62c73cb022f36c2078
Author: Michal Čihař <michal(a)cihar.com>
Date: Thu Feb 25 17:03:48 2010 +0100
Document hooks.cia-project.
commit def1b959efa2e14bb2d27cd71a1d01d341a1d7cc
Author: Michal Čihař <michal(a)cihar.com>
Date: Thu Feb 25 17:03:06 2010 +0100
Reintroduce CIA notifications.
-----------------------------------------------------------------------
Summary of changes:
git-hooks/post-receive | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-hooks/post-receive b/git-hooks/post-receive
index fa1c953..34dcf4b 100755
--- a/git-hooks/post-receive
+++ b/git-hooks/post-receive
@@ -48,6 +48,8 @@
# "t=%s; printf 'http://.../?id=%%s' \$t; echo;echo; git show -C \$t; echo"
# Be careful if "..." contains things that will be expanded by shell "eval"
# or printf.
+# hooks.cia-project
+# Name of CIA project to notify
#
# Notes
# -----
@@ -678,11 +680,13 @@ if [ -n "$1" -a -n "$2" -a -n "$3" ]; then
# Output to the terminal in command line mode - if someone wanted to
# resend an email; they could redirect the output to sendmail
# themselves
- cia_project=""
PAGER= generate_email $2 $3 $1
else
while read oldrev newrev refname
do
generate_email $oldrev $newrev $refname | send_mail
+ if [ -n "$cia_project" ]; then
+ /gitrepo/p/ph/phpmyadmin/scripts/hooks/git-ciabot.pl $newrev $refname
+ fi
done
fi
hooks/post-receive
--
phpMyAdmin scripts