You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Vadim Zeitlin <va...@wxwidgets.org> on 2009/01/21 10:41:22 UTC

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

Hello,

 I'd like to propose a simple patch to commit-email.pl script which adds
--ignore-all-space option to it which is simply passed to svnlook unchanged.
I've just discovered -- after making the patch, of course -- that this
script is now deprecated but maybe this patch could still be applied.

 The patch was not done using svn but is against the latest revision of
contrib/hook-scripts/commit-email.pl.in the trunk (r34134). Please let me
know if you see any problems with it.

 Thanks,
VZ

[[[
Add --ignore-all-space option to commit-email.pl with the same meaning as
the option with the same name in svnlook diff.

Signed-off-by: Vadim Zeitlin <va...@wxwidgets.org>

 commit-email.pl.in |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
]]]

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

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

Posted by Jack Repenning <jr...@collab.net>.
On Jan 21, 2009, at 3:45 AM, Greg Stein wrote:

> Your patch apparently got chewed up by our broken mailing list  
> software :-(

Thanks for the cc:, Greg. On it.

-==-
Jack Repenning
Chief Technology Officer
CollabNet, Inc.
8000 Marina Boulevard, Suite 600
Brisbane, California 94005
office: +1 650.228.2562
mobile: +1 408.835.8090
raindance: +1 877.326.2337, x844.7461
aim: jackrepenning
skype: jackrepenning
twitter: http://twitter.com/jrep

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

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

Posted by Jack Repenning <jr...@collab.net>.
On Jan 21, 2009, at 3:45 AM, Greg Stein wrote:

> Your patch apparently got chewed up by our broken mailing list  
> software :-(

Yes, sadly, Greg is exactly right: the so-called "hot fix" to prevent  
attachment loss did not actually make it into patch 1, applied  
2009-01-09 16:13 PST, and since then we've once again been losing  
attachments.

The hot-fix is being reapplied, and the change has been confirmed in  
patch 2, so it won't be lost again.

Once again, very sorry for the disruption.

-==-
Jack Repenning
Chief Technology Officer
CollabNet, Inc.
8000 Marina Boulevard, Suite 600
Brisbane, California 94005
office: +1 650.228.2562
mobile: +1 408.835.8090
raindance: +1 877.326.2337, x844.7461
aim: jackrepenning
skype: jackrepenning
twitter: http://twitter.com/jrep

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

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

Posted by Greg Stein <gs...@gmail.com>.
Your patch apparently got chewed up by our broken mailing list software :-(

Thanks for resending. Hope that somebody with commit-email knowledge
can review/apply it for you. (I'm knee deep in mailer right now)

Cheers,
-g

On Wed, Jan 21, 2009 at 12:30, Vadim Zeitlin <va...@wxwidgets.org> wrote:
> On Wed, 21 Jan 2009 12:23:10 +0100 Greg Stein <gs...@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

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

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

Posted by Vadim Zeitlin <va...@wxwidgets.org>.
On Wed, 21 Jan 2009 12:23:10 +0100 Greg Stein <gs...@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

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

Posted by Greg Stein <gs...@gmail.com>.
Yeah, that script is deprecated. Maybe somebody can apply the patch
for you, but really... I'd suggest switching over to mailer.py. Maybe
this patch could be redone for that script instead?

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

Cheers,
-g

On Wed, Jan 21, 2009 at 11:41, Vadim Zeitlin <va...@wxwidgets.org> wrote:
> Hello,
>
>  I'd like to propose a simple patch to commit-email.pl script which adds
> --ignore-all-space option to it which is simply passed to svnlook unchanged.
> I've just discovered -- after making the patch, of course -- that this
> script is now deprecated but maybe this patch could still be applied.
>
>  The patch was not done using svn but is against the latest revision of
> contrib/hook-scripts/commit-email.pl.in the trunk (r34134). Please let me
> know if you see any problems with it.
>
>  Thanks,
> VZ
>
> [[[
> Add --ignore-all-space option to commit-email.pl with the same meaning as
> the option with the same name in svnlook diff.
>
> Signed-off-by: Vadim Zeitlin <va...@wxwidgets.org>
>
>  commit-email.pl.in |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> ]]]
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1040845
> Hello,
>
>  I'd like to propose a simple patch to commit-email.pl script which adds
> --ignore-all-space option to it which is simply passed to svnlook unchanged.
> I've just discovered -- after making the patch, of course -- that this
> script is now deprecated but maybe this patch could still be applied.
>
>  The patch was not done using svn but is against the latest revision of
> contrib/hook-scripts/commit-email.pl.in the trunk (r34134). Please let me
> know if you see any problems with it.
>
>  Thanks,
> VZ
>
> [[[
> Add --ignore-all-space option to commit-email.pl with the same meaning as
> the option with the same name in svnlook diff.
>
> Signed-off-by: Vadim Zeitlin <va...@wxwidgets.org>
>
>  commit-email.pl.in |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> ]]]
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1040845
>

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