From Will_Lentz at Trimble.com Mon Apr 19 17:01:06 2004 From: Will_Lentz at Trimble.com (William Lentz) Date: Mon, 19 Apr 2004 10:01:06 -0700 Subject: [cvsspam-devel] Feature requests Message-ID: <7BA55C63511EC34EBB509058F50563B601E7277D@uss-am-xch-02.am.trimblecorp.net> This is a multi-part message in MIME format. ------=_NextPartTM-000-69b157ec-9a83-4b2d-ae6b-b4e2ba914fb3 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C4262F.E7792A54" ------_=_NextPart_001_01C4262F.E7792A54 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, First off, CVSspam is really good! Thanks :-). I had a couple ideas: 1- Some people can't receive HTML email. Maybe just add a "--plaintext_to" option and give a list of people would don't want HTML email? I tried simply running "sendmail" after "collect_diffs.rb" in CVSROOT/loginfo, but it appears only the first command run gets the CVS log info. 2- Right now all CVSspam headers are "[CVS ]". It would be nice to specify different headers for different projects, e.g. "[MODULE_A ]". I've attached a simple patch that does this using a "--header" option. Also - is there an easy way to test CVSspam without actually going through CVS? It's be nice to catch typos before checking files into CVSROOT/. Thanks, Will P.S. Sorry for any Ruby mistakes. I'd never seen it before yesterday. Index: cvsspam.rb =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/CVS/CVSROOT/cvsspam.rb,v retrieving revision 1.1 retrieving revision 1.3 diff -u -r1.1 -r1.3 --- cvsspam.rb 16 Apr 2004 22:39:58 -0000 1.1 +++ cvsspam.rb 16 Apr 2004 23:29:07 -0000 1.3 @@ -890,13 +890,16 @@ require 'getoptlong' =20 opts =3D GetoptLong.new( + [ "--header", "-h", GetoptLong::REQUIRED_ARGUMENT ], [ "--to", "-t", GetoptLong::REQUIRED_ARGUMENT ], [ "--config", "-c", GetoptLong::REQUIRED_ARGUMENT ], [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], [ "--from", "-u", GetoptLong::REQUIRED_ARGUMENT ] ) =20 +$my_header =3D "CVS" opts.each do |opt, arg| + $my_header =3D arg if opt=3D=3D"--header" $recipients << arg if opt=3D=3D"--to" $config =3D arg if opt=3D=3D"--config" $debug =3D true if opt=3D=3D"--debug" @@ -1009,7 +1012,7 @@ end =20 if $subjectPrefix =3D=3D nil - $subjectPrefix =3D "[CVS #{Repository.array.join(',')}]" + $subjectPrefix =3D "[" + $my_header + " = #{Repository.array.join(',')}]" end =20 if $files_in_subject Index: collect_diffs.rb =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/CVS/CVSROOT/collect_diffs.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- collect_diffs.rb 16 Apr 2004 22:45:54 -0000 1.3 +++ collect_diffs.rb 16 Apr 2004 23:26:14 -0000 1.4 @@ -256,6 +256,7 @@ require 'getoptlong' =20 opts =3D GetoptLong.new( + [ "--header", "-h", GetoptLong::REQUIRED_ARGUMENT ], [ "--to", "-t", GetoptLong::REQUIRED_ARGUMENT ], [ "--config", "-c", GetoptLong::REQUIRED_ARGUMENT ], [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], @@ -265,7 +266,7 @@ # arguments to pass though to 'cvsspam.rb' $passthoughArgs =3D Array.new opts.each do |opt, arg| - if ["--to", "--config", "--from"].include?(opt) + if ["--to", "--config", "--from", "--header"].include?(opt) $passthoughArgs << opt << arg end if ["--debug"].include?(opt) ------_=_NextPart_001_01C4262F.E7792A54 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Feature requests

Hi,

First off, CVSspam is really = good!  Thanks :-).

I had a couple ideas:
1- Some people can't receive HTML = email.  Maybe just add a "--plaintext_to" option and give = a list of people would don't want HTML email?  I tried simply = running "sendmail" after "collect_diffs.rb" in = CVSROOT/loginfo, but it appears only the first command run gets the CVS = log info.

2- Right now all CVSspam headers are = "[CVS <dir>]".  It would be nice to specify = different headers for different projects, e.g. "[MODULE_A = <dir>]".  I've attached a simple patch that does this = using a "--header" option.

Also - is there an easy way to test = CVSspam without actually going through CVS?  It's be nice to catch = typos before checking files into CVSROOT/.

Thanks,
Will

P.S. Sorry for any Ruby mistakes.  = I'd never seen it before yesterday.

Index: cvsspam.rb
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
RCS file: = /home/CVS/CVSROOT/cvsspam.rb,v
retrieving revision 1.1
retrieving revision 1.3
diff -u -r1.1 -r1.3
--- cvsspam.rb  16 Apr 2004 = 22:39:58 -0000      1.1
+++ cvsspam.rb  16 Apr 2004 = 23:29:07 -0000      1.3
@@ -890,13 +890,16 @@
 require 'getoptlong'
 
 opts =3D GetoptLong.new(
+  [ "--header", = "-h", GetoptLong::REQUIRED_ARGUMENT ],
   [ = "--to",     "-t", = GetoptLong::REQUIRED_ARGUMENT ],
   [ "--config", = "-c", GetoptLong::REQUIRED_ARGUMENT ],
   [ = "--debug",  "-d", GetoptLong::NO_ARGUMENT = ],
   [ = "--from",   "-u", = GetoptLong::REQUIRED_ARGUMENT ]
 )
 
+$my_header =3D "CVS"
 opts.each do |opt, arg|
+  $my_header =3D arg if = opt=3D=3D"--header"
   $recipients << arg = if opt=3D=3D"--to"
   $config =3D arg if = opt=3D=3D"--config"
   $debug =3D true if = opt=3D=3D"--debug"
@@ -1009,7 +1012,7 @@
 end
 
 if $subjectPrefix =3D=3D = nil
-  $subjectPrefix =3D "[CVS = #{Repository.array.join(',')}]"
+  $subjectPrefix =3D = "[" + $my_header + " = #{Repository.array.join(',')}]"
 end
 
 if $files_in_subject

Index: collect_diffs.rb
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
RCS file: = /home/CVS/CVSROOT/collect_diffs.rb,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- collect_diffs.rb    = 16 Apr 2004 22:45:54 -0000      1.3
+++ collect_diffs.rb    = 16 Apr 2004 23:26:14 -0000      1.4
@@ -256,6 +256,7 @@
 require 'getoptlong'
 
 opts =3D GetoptLong.new(
+  [ "--header", = "-h", GetoptLong::REQUIRED_ARGUMENT ],
   [ = "--to",     "-t", = GetoptLong::REQUIRED_ARGUMENT ],
   [ "--config", = "-c", GetoptLong::REQUIRED_ARGUMENT ],
   [ = "--debug",  "-d", GetoptLong::NO_ARGUMENT = ],
@@ -265,7 +266,7 @@
 # arguments to pass though to = 'cvsspam.rb'
 $passthoughArgs =3D = Array.new
 opts.each do |opt, arg|
-  if ["--to", = "--config", "--from"].include?(opt)
+  if ["--to", = "--config", "--from", = "--header"].include?(opt)
     = $passthoughArgs << opt << arg
   end
   if = ["--debug"].include?(opt)

------_=_NextPart_001_01C4262F.E7792A54-- ------=_NextPartTM-000-69b157ec-9a83-4b2d-ae6b-b4e2ba914fb3-- From dave at badgers-in-foil.co.uk Mon Apr 19 23:24:04 2004 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Mon, 19 Apr 2004 23:24:04 +0000 Subject: [cvsspam-devel] Feature requests In-Reply-To: <7BA55C63511EC34EBB509058F50563B601E7277D@uss-am-xch-02.am.trimblecorp.net> References: <7BA55C63511EC34EBB509058F50563B601E7277D@uss-am-xch-02.am.trimblecorp.net> Message-ID: <20040419232404.GA8833@vhost.badgers-in-foil.co.uk> On Mon, Apr 19, 2004 at 10:01:06AM -0700, William Lentz wrote: > First off, CVSspam is really good! Thanks :-). Thank you. It's appreciated. > I had a couple ideas: > 1- Some people can't receive HTML email. Maybe just add a > "--plaintext_to" option and give a list of people would don't want HTML > email? I tried simply running "sendmail" after "collect_diffs.rb" in > CVSROOT/loginfo, but it appears only the first command run gets the CVS > log info. Allowing for text/plain messages is something that I've had in mind for a while. I never get around to actually refactoring CVSspam's internals to make it happen though :( Ideally, there would be '--plain-to', '--html-to' and '--to' options, to send text/plain, text/html and multipart/alternative (i.e. both). > 2- Right now all CVSspam headers are "[CVS ]". It would be nice to > specify different headers for different projects, e.g. "[MODULE_A > ]". I've attached a simple patch that does this using a "--header" > option. Did you notice the code dealing with '$repository_name'? If not, could that logic be re-used to work out the subject-prefix? I know that some installations using multiple repositories set up each one in a directory named for the project, in which case this directory name could be used for the prefix. (NB cvsspam.rb is a bit confised about what the word 'repository' refers to. Sorry about that.) > Also - is there an easy way to test CVSspam without actually going > through CVS? It's be nice to catch typos before checking files into > CVSROOT/. Create a 'fake' CVS repository in a local directory, e.g., mkdir ~/fakecvs CVSROOT=~/fakecvs export CVSROOT cvs init cvs checkout CVSROOT ... play with files in the checked-out CVSROOT ... Remember to copy your files somewhere safe before deleting those temporary directories. dave