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

Re: how to add email address (how to specify recipients for commit-email.pl)

From: Ryan Schmidt <subversion-2006Q1_at_ryandesign.com>
Date: 2005-12-20 18:09:53 CET

Don't forget to CC the list when you reply so others can benefit from
this discussion.

On Dec 20, 2005, at 17:14, tony sidhu wrote:

>>> I have part set up commit-email.pl. I have one question though,
>>> where (or how) do I specify the list of email addresses that should
>>> receive an email upon a commit?
>>
>> I believe you specify it in the command line when you execute the
>> commit-email.pl script. Call the script with no arguments to read the
>> usage message.
>
> Thanks for the quick response. I think that works for the "reply-to
> email" and "from email" addresses.

Yes, but it's also where you specify the recipients. Here's the usage
message I was talking about:

$ perl commit-email.pl
commit-email.pl: too few arguments.
usage: commit-email.pl REPOS REVNUM [[-m regex] [options]
[email_addr ...]] ...
options are
   --from email_address Email address for 'From:' (overrides -h)
   -h hostname Hostname to append to author for 'From:'
   -l logfile Append mail contents to this log file
   -m regex Regular expression to match committed path
   -r email_address Email address for 'Reply-To:'
   -s subject_prefix Subject line prefix

This script supports a single repository with multiple projects,
where each project receives email only for commits that modify that
project. A project is identified by using the -m command line
with a regular expression argument. If a commit has a path that
matches the regular expression, then the entire commit matches.
Any of the following -h, -l, -r and -s command line options and
following email addresses are associated with this project. The
next -m resets the -h, -l, -r and -s command line options and the
list of email addresses.

To support a single project conveniently, the script initializes
itself with an implicit -m . rule that matches any modifications
to the repository. Therefore, to use the script for a single
project repository, just use the other comand line options and
a list of email addresses on the command line. If you do not want
a project that matches the entire repository, then use a -m with a
regular expression before any other command line options or email
addresses.

> What I am looking for is for example:
>
> If I tsidhuus@yahoo.com would like to receive commit emails. So if
> another developer does a commit using TortoiseSVN from their PC,
> then SVN should send me an email of that other developers commit.
>
> So should these "subscriptions for commit emails" be in some sort
> of config file where it says tsidhuus@yahoo.com has subscribed to
> the repository /svn/myproject for commit messages.

There is no config file. It's all in the command line parameters:

/path/to/commit-email.pl \
"$REPOS" "$REV" \
--from repository@example.com \
-s "[svn] " \
tsidhuus@yahoo.com \
another_developer@example.com \
yet_another_developer@example.org

If you want to receive commit mails only for changes made to the
path /myproject in the repository, and another_developer wants to
receive only changes made to /anotherproject, and
yet_another_developer wants to receive changes made anywhere, then
you can specify that with regular expressions:

/path/to/commit-email.pl \
"$REPOS" "$REV" \
--from repository@example.com \
-m '^/myproject/' \
-s '[myproject] ' \
tsidhuus@yahoo.com \
-m '^/anotherproject/' \
-s '[anotherproject] ' \
another_developer@example.com \
-m '.' \
-s '[svn] ' \
yet_another_developer@example.org

The above is all untested, by the way; I'm just extrapolating from
the documentation.

If you don't have everything in one repository, but have several
separate repositories, then each repository has its own hooks
directory and you can call the commit-email.pl script with different
parameters for each repository if you like.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Dec 20 18:28:39 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.