[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: Rob van Oostrum <rob.vanoostrum_at_blastradius.com>
Date: 2005-08-30 03:05:13 CEST

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
Received on Tue Aug 30 03:07:11 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.