You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bryan Cribbs <br...@cuwireless.net> on 2004/12/22 23:24:08 UTC
commit-email.pl w/o diffs
The following is a very simple patch to commit-email.pl.in
to provide administrators the option of not including diffs
in the emails sent. The option added is "-d (yes|no)", and
if the option is unspecified, the diffs are included.
-Bryan
PS. Please send any responses to me explicitly, I am not a
dev subscriber.
--
Index: subversion/tools/hook-scripts/commit-email.pl.in
===================================================================
--- subversion/tools/hook-scripts/commit-email.pl.in (revision 12497)
+++ subversion/tools/hook-scripts/commit-email.pl.in (working copy)
@@ -98,7 +98,8 @@
# This hash matches the command line option to the hash key in the
# project. If a key exists but has a false value (''), then the
# command line option is allowed but requires special handling.
-my %opt_to_hash_key = ('--from' => 'from_address',
+my %opt_to_hash_key = ('-d' => 'include_diffs',
+ '--from' => 'from_address',
'-h' => 'hostname',
'-l' => 'log_file',
'-m' => '',
@@ -277,8 +278,14 @@
# Get the diff from svnlook.
my @no_diff_deleted = $no_diff_deleted ? ('--no-diff-deleted') : ();
-my @difflines = &read_from_process($svnlook, 'diff', $repos,
+my @difflines = "";
+
+if (not defined($project_settings_list[0]->{include_diffs}) or
+ $project_settings_list[0]->{include_diffs} ne "no")
+ {
+ @difflines = &read_from_process($svnlook, 'diff', $repos,
'-r', $rev, @no_diff_deleted);
+ }
######################################################################
# Modified directory name collapsing.
@@ -487,6 +494,7 @@
warn "@_\n" if @_;
die "usage: $0 REPOS REVNUM [[-m regex] [options] [email_addr ...]] ...\n",
"options are\n",
+ " -d (yes|no) Include diffs in the Email (default: yes)\n",
" --from email_address Email address for 'From:' (overrides -h)\n",
" -h hostname Hostname to append to author for 'From:'\n",
" -l logfile Append mail contents to this log file\n",
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: commit-email.pl w/o diffs
Posted by Michael W Thelen <mi...@pietdepsi.com>.
Bryan Cribbs wrote:
> The following is a very simple patch to commit-email.pl.in
> to provide administrators the option of not including diffs
> in the emails sent. The option added is "-d (yes|no)", and
> if the option is unspecified, the diffs are included.
Thanks for the patch! I've filed it as issue #2191:
http://subversion.tigris.org/issues/show_bug.cgi?id=2191
--
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes. -- Douglas Adams