You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Peter Samuelson <pe...@p12n.org> on 2008/11/11 05:01:26 UTC
Re: [PATCH] fix for incorrect/missing mail headers in
commit-email.pl
[Michiel Holtkamp]
> "From author Mon Nov 10 12:41:54 PM 2008".
>
> This is supposed to be output only when --stdout option of
> commit-email.pl is selected, but due to logic error, this was always
> output.
Good catch, fixed in r34134.
Thanks,
--
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] fix for incorrect/missing mail headers in
commit-email.pl
Posted by Michiel Holtkamp <mi...@elfstone.nl>.
On Jan 21, 2009, at 22:02 , Martin Furter wrote:
> I guess it's easier to manage a text file containing one To: address
> per line instead of a config file.
> The following (untested) patch adds that feature to mailer.py .
> (I can't test it since I do not have the bindings installed yet, but
> I'll do if there's interest in this feature.)
I have interest in this feature if it's not too troublesome to
maintain, but it looks simple enough. This would be a little bit
easier to automate.
Thanks for the input!
Regards,
Michiel
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041163
Re: [PATCH] fix for incorrect/missing mail headers in
commit-email.pl
Posted by Michiel Holtkamp <mi...@elfstone.nl>.
On Jan 21, 2009, at 22:15 , Greg Stein wrote:
> The config file doesn't need a whole lot in it. You could do
> something like:
>
> [general]
> mail_command = /usr/sbin/sendmail
> [defaults]
> from_addr = noreply@example.com
> generate_diffs = add copy modify
> to_addr =
> john@example.com
> jane@example.com
> third@example.com
Ok, I guess there is something to say to keep the mailer.py as simple
as possible. I can work with this just as well.
> IOW, it would be just like a file with a list of addresses, but with a
> few lines of prefix.
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041173
Re: [PATCH] fix for incorrect/missing mail headers in
commit-email.pl
Posted by Greg Stein <gs...@gmail.com>.
On Wed, Jan 21, 2009 at 14:02, Martin Furter <mf...@rola.ch> wrote:
>
> I guess it's easier to manage a text file containing one To: address per
> line instead of a config file.
> The following (untested) patch adds that feature to mailer.py .
> (I can't test it since I do not have the bindings installed yet, but I'll do
> if there's interest in this feature.)
The config file doesn't need a whole lot in it. You could do something like:
[general]
mail_command = /usr/sbin/sendmail
[defaults]
from_addr = noreply@example.com
generate_diffs = add copy modify
to_addr =
john@example.com
jane@example.com
third@example.com
IOW, it would be just like a file with a list of addresses, but with a
few lines of prefix.
Cheers,
-g
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041169
Re: [PATCH] fix for incorrect/missing mail headers in
commit-email.pl
Posted by Martin Furter <mf...@rola.ch>.
I guess it's easier to manage a text file containing one To: address per
line instead of a config file.
The following (untested) patch adds that feature to mailer.py .
(I can't test it since I do not have the bindings installed yet, but I'll
do if there's interest in this feature.)
Martin
[[[
Add support for reading a file containing one To: address per line.
* tools/hook-scripts/mailer/mailer.py:
(MailedOutput.start): Read to_addr_file if set in the config file.
* tools/hook-scripts/mailer/mailer.conf.example: Add to_addr_file.
]]]
Index: tools/hook-scripts/mailer/mailer.py
===================================================================
--- tools/hook-scripts/mailer/mailer.py (revision 35361)
+++ tools/hook-scripts/mailer/mailer.py (working copy)
@@ -224,18 +224,29 @@
OutputBase.__init__(self, cfg, repos, prefix_param)
def start(self, group, params):
- # whitespace (or another character) separated list of addresses
- # which must be split into a clean list
- to_addr_in = self.cfg.get('to_addr', group, params)
- # if list of addresses starts with '[.]'
- # use the character between the square brackets as split char
- # else use whitespaces
- if len(to_addr_in) >= 3 and to_addr_in[0] == '[' \
- and to_addr_in[2] == ']':
- self.to_addrs = \
- [_f for _f in to_addr_in[3:].split(to_addr_in[1]) if _f]
+ to_addr_file = self.cfg.get('to_addr_file', group, params)
+ if len(to_addr_file) > 0:
+ # read to_addr_file containing one To: address per line
+ self.to_addrs = []
+ inputfile = open(to_addr_file, "r")
+ for to_addr in inputfile:
+ to_addr = to_addr.strip()
+ if len(to_addr) > 0:
+ self.to_addrs.append(to_addr.strip())
+ inputfile.close()
else:
- self.to_addrs = [_f for _f in to_addr_in.split() if _f]
+ # whitespace (or another character) separated list of addresses
+ # which must be split into a clean list
+ to_addr_in = self.cfg.get('to_addr', group, params)
+ # if list of addresses starts with '[.]'
+ # use the character between the square brackets as split char
+ # else use whitespaces
+ if len(to_addr_in) >= 3 and to_addr_in[0] == '[' \
+ and to_addr_in[2] == ']':
+ self.to_addrs = \
+ [_f for _f in to_addr_in[3:].split(to_addr_in[1]) if _f]
+ else:
+ self.to_addrs = [_f for _f in to_addr_in.split() if _f]
self.from_addr = self.cfg.get('from_addr', group, params) \
or self.repos.author or 'no_author'
# if the from_addr (also) starts with '[.]' (may happen if one
Index: tools/hook-scripts/mailer/mailer.conf.example
===================================================================
--- tools/hook-scripts/mailer/mailer.conf.example (revision 35361)
+++ tools/hook-scripts/mailer/mailer.conf.example (working copy)
@@ -173,6 +173,10 @@
# brackets '[ ]'.
to_addr = invalid@example.com
+# Name of a file containing one To: address per line. If this entry
+# is not empty above to_addr will be ignored.
+to_addr_file =
+
# If this is set, then a Reply-To: will be inserted into the message.
reply_to =
On Wed, 21 Jan 2009, Greg Stein wrote:
> I take it that your system somehow allows for altering the invocation
> of the commit-email.pl script? As each user wants to receive email,
> they simply throw themselves onto the command line?
>
> This would seem to imply that the hook script which invokes
> commit-email gets rewritten each time somebody wants to receive an
> email. It seems that you could have a simple mailer.conf per
> repository, a constant hook script, and your system just rewrites the
> .conf to append/remove people from the to_addr list. Would that work
> in your situation?
>
> [looking at mailer.py and commit-email stuffs today]
>
> Cheers,
> -g
>
> On Tue, Nov 11, 2008 at 08:12, Michiel Holtkamp <mi...@elfstone.nl> wrote:
>> For mailer question, see below.
>>
>> On Nov 11, 2008, at 16:01 , Daniel Shahaf wrote:
>>
>>> I'm not wearing my PM hat in this thread. The place to ask is the list,
>>> so CCing them, maybe they'll know the answer to your question.
>>
>> Whoops, I missed that.
>>
>> Ok list, does anyone have an answer to the following question?
>>
>> I'm using commit-email.pl for my project (http://supermind.nl/submin/)
>> sousers can configure themselves if they want to receive email for every
>> commit. It seems that mailer.py is not able to send emails without
>> specifying alle the emails in the config-file. To write a specific
>> config-file each commit (or check if users changed their settings since the
>> last commit) seems a bit bothersome and error-prone to me.
>>
>> Is there a better solution, other than using commit-email.pl (deprecated) or
>> mailer.py (only email addresses in config file)?
>>
>> Thanks in advance,
>> Michiel
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>> For additional commands, e-mail: dev-help@subversion.tigris.org
>>
>>
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1040899
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041153
Re: [PATCH] fix for incorrect/missing mail headers in
commit-email.pl
Posted by Michiel Holtkamp <mi...@elfstone.nl>.
On Jan 21, 2009, at 21:09 , Greg Stein wrote:
> Yup. Could get to be quite slow, re-reading the repository each time
> to generate the email. Not to mention that commit-email forks off
> svnlook for its operation rather than binding to the libraries.
Another reason to change this.
> If you want to maintain confidentiality, then I believe that you could
> auto-generate N "groups" in the mailer.conf file, each with a
> different to_addr value. mailer.py will then deliver one message per
> group, each addressed to a single person. The changeset will be
> computed once, although it will re-execute the diff logic for each
> message.
Ok, thanks for the tip! I'll add it to the bug tracking ticket.
> Well... you could construct a .conf file on-the-fly in /tmp, run
> mailer.py, and then remove the file.
Oh yeah, thought about that option too, but forgot to include it in my
email. I don't like temporary files either, too much hassle to do it
safe and correctly. I'll probably go for the one-mailer-conf-per-
repository-with-N-groups then.
Regards,
Michiel
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041083
Re: [PATCH] fix for incorrect/missing mail headers in
commit-email.pl
Posted by Greg Stein <gs...@gmail.com>.
I take it that your system somehow allows for altering the invocation
of the commit-email.pl script? As each user wants to receive email,
they simply throw themselves onto the command line?
This would seem to imply that the hook script which invokes
commit-email gets rewritten each time somebody wants to receive an
email. It seems that you could have a simple mailer.conf per
repository, a constant hook script, and your system just rewrites the
.conf to append/remove people from the to_addr list. Would that work
in your situation?
[looking at mailer.py and commit-email stuffs today]
Cheers,
-g
On Tue, Nov 11, 2008 at 08:12, Michiel Holtkamp <mi...@elfstone.nl> wrote:
> For mailer question, see below.
>
> On Nov 11, 2008, at 16:01 , Daniel Shahaf wrote:
>
>> I'm not wearing my PM hat in this thread. The place to ask is the list,
>> so CCing them, maybe they'll know the answer to your question.
>
> Whoops, I missed that.
>
> Ok list, does anyone have an answer to the following question?
>
> I'm using commit-email.pl for my project (http://supermind.nl/submin/)
> sousers can configure themselves if they want to receive email for every
> commit. It seems that mailer.py is not able to send emails without
> specifying alle the emails in the config-file. To write a specific
> config-file each commit (or check if users changed their settings since the
> last commit) seems a bit bothersome and error-prone to me.
>
> Is there a better solution, other than using commit-email.pl (deprecated) or
> mailer.py (only email addresses in config file)?
>
> Thanks in advance,
> Michiel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1040899
Re: [PATCH] fix for incorrect/missing mail headers in commit-email.pl
Posted by Michiel Holtkamp <mi...@elfstone.nl>.
On Nov 12, 2008, at 4:23 , C. Michael Pilato wrote:
> The traditional solution for this is to setup an opt-in mailing list
> (Google
> Group, YaHoo! Group, etc.) for commit emails, to which your mailer
> script
> always transmits, but to which only folks that care are
> unsubscribed. Does
> that not work in your situation?
It's a good option if your repositories don't change much, that's for
sure.
In my case, I want a flexible environment where you can create a
repository for a short period of time with a couple of persons. For
example, I use it to collaborate with fellow students, one repository
for each course, seperate permissions (because of different group
members) and seperate mailing notifications. I'm just too lazy to
setup a new mailinglist for each project and I'm making submin for
people who are just as lazy as I am :)
Also, I want all configuration in one spot, so you don't have to login
to different systems. That's the whole idea of submin: easy
configuration, spending as little time at configuring the repositories
and more time in the actual development of your projects.
Thanks for the input though, if there are no more suggestions, I think
I'll just keep on using the (soon to be deprecated) commit-email.pl
and later on try to make it work for mailer.py.
Regards,
Michiel
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] fix for incorrect/missing mail headers in commit-email.pl
Posted by "C. Michael Pilato" <cm...@collab.net>.
Michiel Holtkamp wrote:
> For mailer question, see below.
>
> On Nov 11, 2008, at 16:01 , Daniel Shahaf wrote:
>
>> I'm not wearing my PM hat in this thread. The place to ask is the list,
>> so CCing them, maybe they'll know the answer to your question.
>
> Whoops, I missed that.
>
> Ok list, does anyone have an answer to the following question?
>
> I'm using commit-email.pl for my project (http://supermind.nl/submin/)
> sousers can configure themselves if they want to receive email for every
> commit. It seems that mailer.py is not able to send emails without
> specifying alle the emails in the config-file. To write a specific
> config-file each commit (or check if users changed their settings since
> the last commit) seems a bit bothersome and error-prone to me.
>
> Is there a better solution, other than using commit-email.pl
> (deprecated) or mailer.py (only email addresses in config file)?
The traditional solution for this is to setup an opt-in mailing list (Google
Group, YaHoo! Group, etc.) for commit emails, to which your mailer script
always transmits, but to which only folks that care are unsubscribed. Does
that not work in your situation?
--
C. Michael Pilato <cm...@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
Re: [PATCH] fix for incorrect/missing mail headers in commit-email.pl
Posted by Michiel Holtkamp <mi...@elfstone.nl>.
For mailer question, see below.
On Nov 11, 2008, at 16:01 , Daniel Shahaf wrote:
> I'm not wearing my PM hat in this thread. The place to ask is the
> list,
> so CCing them, maybe they'll know the answer to your question.
Whoops, I missed that.
Ok list, does anyone have an answer to the following question?
I'm using commit-email.pl for my project (http://supermind.nl/submin/)
sousers can configure themselves if they want to receive email for
every commit. It seems that mailer.py is not able to send emails
without specifying alle the emails in the config-file. To write a
specific config-file each commit (or check if users changed their
settings since the last commit) seems a bit bothersome and error-prone
to me.
Is there a better solution, other than using commit-email.pl
(deprecated) or mailer.py (only email addresses in config file)?
Thanks in advance,
Michiel
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] fix for incorrect/missing mail headers in
commit-email.pl
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
I'm not wearing my PM hat in this thread. The place to ask is the list,
so CCing them, maybe they'll know the answer to your question.
Daniel
Michiel Holtkamp wrote on Tue, 11 Nov 2008 at 15:45 +0900:
> Hey Danial.
>
> Thanks for the heads up!
>
> I'm using commit-email.pl for my project (http://supermind.nl/submin/) so
> users can configure themselves if they want to receive email for every commit.
> It seems that mailer.py is not able to send emails without specifying alle the
> emails in the config-file. To write a specific config-file each commit (or
> check if users changed their settings since the last commit) seems a bit
> bothersome and error-prone to me.
>
> Being aware that you are 'only' the patch-manager and possibly not the right
> person to ask this, I still want to ask you if you know of a better solution?
> If not, do you know the proper place to ask?
>
> Thanks for your time,
> Michiel
>
> On Nov 11, 2008, at 15:34 , Daniel Shahaf wrote:
>
> > Note that commit-email.pl is being deprecated (see CHANGES in trunk).
> >
> > Daniel
> >
> > Peter Samuelson wrote on Mon, 10 Nov 2008 at 23:01 -0600:
> > >
> > > [Michiel Holtkamp]
> > > > "From author Mon Nov 10 12:41:54 PM 2008".
> > > >
> > > > This is supposed to be output only when --stdout option of
> > > > commit-email.pl is selected, but due to logic error, this was always
> > > > output.
> > >
> > > Good catch, fixed in r34134.
> > >
> > > Thanks,
> > >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] fix for incorrect/missing mail headers in
commit-email.pl
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Note that commit-email.pl is being deprecated (see CHANGES in trunk).
Daniel
Peter Samuelson wrote on Mon, 10 Nov 2008 at 23:01 -0600:
>
> [Michiel Holtkamp]
> > "From author Mon Nov 10 12:41:54 PM 2008".
> >
> > This is supposed to be output only when --stdout option of
> > commit-email.pl is selected, but due to logic error, this was always
> > output.
>
> Good catch, fixed in r34134.
>
> Thanks,
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org