[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: SVN Post Commit Email Notifications

From: S I <xiamak_at_hotmail.com>
Date: 2005-08-30 04:00:19 CEST

Thanks. I did do "sudo perl path/commit-email.pl ..." And added 'exit 2'
to the end of the post-commit file. So looks like the email.pl file gets
executed w/o any errors, otherwise the exit2 option would've sent me the
STDERR, no? Could be easily my permissions. I have to walk through it with
the Admin guys. thanks again.

----Original Message Follows----
From: "Rob van Oostrum" <rob.vanoostrum@blastradius.com>
To: <users@subversion.tigris.org>
Subject: RE: SVN Post Commit Email Notifications
Date: Mon, 29 Aug 2005 21:05:13 -0400
MIME-Version: 1.0
Received: from tigris.org ([64.125.133.100]) by mc5-f2.hotmail.com with
Microsoft SMTPSVC(6.0.3790.211); Mon, 29 Aug 2005 18:06:50 -0700
Received: (qmail 7022 invoked by uid 5000); 30 Aug 2005 01:05:26 -0000
Received: (qmail 7003 invoked from network); 30 Aug 2005 01:05:25 -0000
X-Message-Info: JGTYoYF78jE/ORf9+nUEanJFT2PeLjE45X4v5aPcmUw=
Mailing-List: contact users-help@subversion.tigris.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
list-help: <mailto:users-help@subversion.tigris.org>
list-unsubscribe: <mailto:users-unsubscribe@subversion.tigris.org>
list-post: <mailto:users@subversion.tigris.org>
Delivered-To: mailing list users@subversion.tigris.org
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: SVN Post Commit Email Notifications
Thread-Index: AcWs6bOUShyciM8KTtS3HcYf88WnHwAFMpfg
Return-Path: users-return-37638-xiamak=hotmail.com@subversion.tigris.org
X-OriginalArrivalTime: 30 Aug 2005 01:06:50.0424 (UTC)
FILETIME=[1A166380:01C5ACFF]

You mention you have to sudo the call when running the script manually.
Since you're not sudoing the call from the hook script, what you're
doing manually does not seem to match what Subversion is doing at
runtime.

Try adding sudo to the call in the script, or investigate what
permission issues may be at play here. My guess is your permissions are
too tight somewhere in the chain of events.

Cheers
Rob

-----Original Message-----
From: S I [mailto:xiamak@hotmail.com]
Sent: Monday, August 29, 2005 6:32 PM
To: users@subversion.tigris.org
Subject: SVN Post Commit Email Notifications

5. By the way, I have to run everything at the command prompt as 'sudo'!

Could this be another source of problem?

I tell you SVN is NOT easy to set up and configure. It was created to
overcome the idiosyncrasies of CVS, but does it? This has not been my
experience so far and I'm getting to really dislike it. I shouldn't be
spending days administering it.

Here's the content of my 2 files under hooks:

post-commit:

------------------------------------------------------------------------
-----------------------------
#! /bin/sh

# POST-COMMIT HOOK
#
# The post-commit hook is invoked after a commit. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-commit' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] REV (the number of the revision just committed)
#
# The default working directory for the invocation is undefined, so
# the program should set one explicitly if it cares.
#
# Because the commit has already completed and cannot be undone,
# the exit code of the hook program is ignored. The hook program
# can use the 'svnlook' utility to help it examine the
# newly-committed tree.
#
# On a Unix system, the normal procedure is to have 'post-commit'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'post-commit' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'post-commit.bat' or 'post-commit.exe',
# but the basic idea is the same.
#
# The hook program typically does not inherit the environment of
# its parent process. For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program, the
# culprit may be unusual (or missing) environment variables.
#
# Here is an example hook script, for a Unix /bin/sh interpreter.# For
more
examples and pre-written hooks, see those in
# the Subversion repository at
# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/

REPOS="$1"
REV="$2"

/local1/svn/hooks/commit-email.pl "$REPOS" "$REV" -s "SVN Notification:
"
myemail@mydomain.com
#log-commit.py --repository "$REPOS" --revision "$REV"

exit 2

------------------------------------------------------------------------
-----------------------------

EXCERPTS OF commit-email.pl:

------------------------------------------------------------------------
-----------------------------

#!/usr/bin/env perl #This is the original shebang & I
left it
intact, do I need to change it?

# ====================================================================
# commit-email.pl: send a commit email for commit REVISION in
# repository REPOS to some email addresses.
#
# For usage, see the usage subroutine or run the script with no
# command line arguments.
#
# $HeadURL:
http://svn.collab.net/repos/svn/branches/1.2.x/tools/hook-scripts/commit
-email.pl.in
$
# $LastChangedDate: 2005-02-22 04:24:08 -0500 (Tue, 22 Feb 2005) $
# $LastChangedBy: maxb $
# $LastChangedRevision: 13107 $
#
# ====================================================================
# Copyright (c) 2000-2004 CollabNet. All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://subversion.tigris.org/license-1.html.
# If newer versions of this license are posted there, you may use a
# newer version instead, at your option.
#
# This software consists of voluntary contributions made by many
# individuals. For exact contribution history, see the revision
# history and logs, available at http://subversion.tigris.org/.
# ====================================================================

# Turn on warnings the best way depending on the Perl version.
BEGIN {
   if ( $] >= 5.006_000)
     { require warnings; import warnings; }
   else
     { $^W = 1; }
}

use strict;
use Carp;

######################################################################
# Configuration section.

# Sendmail path.
my $sendmail = "/usr/sbin/sendmail";

# Svnlook path.
my $svnlook = "/usr/bin/svnlook";

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Aug 30 04:02:17 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.