Login | Register
My pages Projects Community openCollabNet

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

subversion
Discussion topic

Back to topic list

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

Author zeitlin
Full name Vadim Zeitlin
Date 2009-01-21 03:30:08 PST
Message On Wed, 21 Jan 2009 12:23:10 +0100 Greg Stein <gstein at gmail dot 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_proce​ss($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",
Attachments

« Previous message in topic | 3 of 6 | Next message in topic »

Messages

Show all messages in topic

[PATCH] add support for ignoring white-space to commit-email.pl zeitlin Vadim Zeitlin 2009-01-21 02:41:27 PST
     Re: [PATCH] add support for ignoring white-space to commit-email.pl gstein Greg Stein 2009-01-21 03:23:12 PST
         Re[2]: [PATCH] add support for ignoring white-space to commit-email.pl zeitlin Vadim Zeitlin 2009-01-21 03:30:08 PST
             Re: Re[2]: [PATCH] add support for ignoring white-space to commit-email.pl gstein Greg Stein 2009-01-21 03:45:30 PST
                 Re: Re[2]: [PATCH] add support for ignoring white-space to commit-email.pl jackrepenning Jack Repenning 2009-01-21 13:03:36 PST
                 Re: Re[2]: [PATCH] add support for ignoring white-space to commit-email.pl jackrepenning Jack Repenning 2009-01-21 16:19:43 PST
Messages per page: