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

Re[2]: [PATCH] add support for ignoring white-space to commit-email.pl

From: Vadim Zeitlin <vadim_at_wxwidgets.org>
Date: Wed, 21 Jan 2009 12:30:04 +0100

On Wed, 21 Jan 2009 12:23:10 +0100 Greg Stein <gstein_at_gmail.com> wrote:

GS> Yeah, that script is deprecated. Maybe somebody can apply the patch
GS> for you, but really... I'd suggest switching over to mailer.py. Maybe
GS> this patch could be redone for that script instead?

 Hi,

 Unfortunately mailer.py doesn't use svnlook at all and I don't know
anything about svn bindings for Python (I'd like to learn about them but
this will have to wait...) so the patch would need to be done very
differently for it. And then there is a fact that I have quite a few post
commit hooks in my own repositories using commit-email.pl and deprecated
though it is, I have absolutely no complaints about it.

GS> Also note: you didn't attach the actual patch :-P

 Actually I did, as a text/plain attachment with inline disposition but it
somehow seems to have been lost on its way... Really no idea what happened,
sorry. But here is the patch again, this time inline.

 Thanks again,
VZ

--- contrib/hook-scripts/commit-email.pl.in 2009-01-21 11:30:08.000000000 +0100
+++ contrib/hook-scripts/commit-email.pl.in 2009-01-21 11:34:36.000000000 +0100
@@ -152,6 +152,7 @@
                        '-s' => 'subject_prefix',
                        '--summary' => '',
                        '--diff' => '',
+ '--ignore-all-space' => '',
                        '--stdout' => '');
 
 while (@ARGV)
@@ -166,7 +167,8 @@
           }
 
         my $value;
- if ($arg ne '--revprop-change' and $arg ne '--stdout' and $arg ne '--summary')
+ if ($arg ne '--revprop-change' and $arg ne '--stdout'
+ and $arg ne '--summary' and $arg ne '--ignore-all-space')
           {
             unless (@ARGV)
               {
@@ -214,6 +216,10 @@
               {
                 $current_project->{show_diff} = parse_boolean($value);
               }
+ elsif ($arg eq '--ignore-all-space')
+ {
+ $current_project->{ignore_all_space} = 1;
+ }
             elsif ($arg eq '--stdout')
               {
                 $current_project->{stdout} = 1;
@@ -612,9 +618,10 @@
         # Get the diff from svnlook.
         my @no_diff_deleted = $no_diff_deleted ? ('--no-diff-deleted') : ();
         my @no_diff_added = $no_diff_added ? ('--no-diff-added') : ();
+ my @ignore_all_space = $project->{ignore_all_space} ? ('-x -w') : ();
         @difflines = &read_from_process($svnlook, 'diff', $repos,
                                         '-r', $rev, @no_diff_deleted,
- @no_diff_added);
+ @no_diff_added, @ignore_all_space);
         @difflines = map { /[\r\n]+$/ ? $_ : "$_\n" } @difflines;
       }
 
@@ -701,6 +708,7 @@
       " --summary Use first line of commit log in subject\n",
       " --diff y|n Include diff in message (default: y)\n",
       " (applies to commit mode only)\n",
+ " --ignore-all-space Ignore all white space changes in the diff\n",
       " --stdout Spit the message in mbox format to stdout.\n",
       "\n",
       "This script supports a single repository with multiple projects,\n",

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1040904

  • APPLICATION/PGP-SIGNATURE attachment: stored
Received on 2009-01-21 12:32:53 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.