You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Gregory Nathan Price <pr...@mit.edu> on 2008/03/28 17:27:27 UTC

[PATCH] commit-email.pl: support subject line based on log message

This adds to commit-email.pl a flag --summary,
which produces subject lines like
  r123 - Stop frobbing the veeblenitzer
instead of the familiar
  r123 - in src/veeble: . nitzed
, copying the first line of the log message into the subject line.

[[[
* tools/hook-scripts/commit-email.pl.in
  Support --summary for taking subject line from log message.

Patch by: Greg Price <pr...@mit.edu>
]]]

I've generally preferred this form of subject line in the small
projects I've worked on, and would be very pleased to get it with
a flag rather than patching commit-email.pl every time.

Greg

Re: [PATCH] commit-email.pl: support subject line based on log message

Posted by Blair Zajac <bl...@orcaware.com>.
David Glasser wrote:
> On Mon, Mar 31, 2008 at 3:52 PM, Blair Zajac <bl...@orcaware.com> wrote:
>> David Glasser wrote:
>>  > 2008/3/28 Gregory Nathan Price <pr...@mit.edu>:
>>  >> This adds to commit-email.pl a flag --summary,
>>  >>  which produces subject lines like
>>  >>   r123 - Stop frobbing the veeblenitzer
>>  >>  instead of the familiar
>>  >>   r123 - in src/veeble: . nitzed
>>  >>  , copying the first line of the log message into the subject line.
>>  >>
>>  >>  [[[
>>  >>  * tools/hook-scripts/commit-email.pl.in
>>  >>   Support --summary for taking subject line from log message.
>>  >>
>>  >>  Patch by: Greg Price <pr...@mit.edu>
>>  >>  ]]]
>>  >>
>>  >>  I've generally preferred this form of subject line in the small
>>  >>  projects I've worked on, and would be very pleased to get it with
>>  >>  a flag rather than patching commit-email.pl every time.
>>  >
>>  > Looks reasonable to me.  However, instead of:
>>  >
>>  >     chop(my $summary = $log[0]);
>>  >
>>  > how about
>>  >
>>  >     my $summary = @log ? $log[0] : '';
>>  >     chop $summary;
>>
>>  Or
>>
>>  <bikeshed>
>>      my $summary = @log ? chomp($log[0]) : '';
>>  </bikeshed>
> 
> chomp is probably better than chop, but modifying $log[0] sounds bad to me.

Ahh, I forgot that chomp modifies its argument.

Happy to stay away from perl :)

Blair


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] commit-email.pl: support subject line based on log message

Posted by David Glasser <gl...@davidglasser.net>.
On Mon, Mar 31, 2008 at 3:52 PM, Blair Zajac <bl...@orcaware.com> wrote:
>
> David Glasser wrote:
>  > 2008/3/28 Gregory Nathan Price <pr...@mit.edu>:
>  >> This adds to commit-email.pl a flag --summary,
>  >>  which produces subject lines like
>  >>   r123 - Stop frobbing the veeblenitzer
>  >>  instead of the familiar
>  >>   r123 - in src/veeble: . nitzed
>  >>  , copying the first line of the log message into the subject line.
>  >>
>  >>  [[[
>  >>  * tools/hook-scripts/commit-email.pl.in
>  >>   Support --summary for taking subject line from log message.
>  >>
>  >>  Patch by: Greg Price <pr...@mit.edu>
>  >>  ]]]
>  >>
>  >>  I've generally preferred this form of subject line in the small
>  >>  projects I've worked on, and would be very pleased to get it with
>  >>  a flag rather than patching commit-email.pl every time.
>  >
>  > Looks reasonable to me.  However, instead of:
>  >
>  >     chop(my $summary = $log[0]);
>  >
>  > how about
>  >
>  >     my $summary = @log ? $log[0] : '';
>  >     chop $summary;
>
>  Or
>
>  <bikeshed>
>      my $summary = @log ? chomp($log[0]) : '';
>  </bikeshed>

chomp is probably better than chop, but modifying $log[0] sounds bad to me.

--dave

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] commit-email.pl: support subject line based on log message

Posted by Blair Zajac <bl...@orcaware.com>.
David Glasser wrote:
> 2008/3/28 Gregory Nathan Price <pr...@mit.edu>:
>> This adds to commit-email.pl a flag --summary,
>>  which produces subject lines like
>>   r123 - Stop frobbing the veeblenitzer
>>  instead of the familiar
>>   r123 - in src/veeble: . nitzed
>>  , copying the first line of the log message into the subject line.
>>
>>  [[[
>>  * tools/hook-scripts/commit-email.pl.in
>>   Support --summary for taking subject line from log message.
>>
>>  Patch by: Greg Price <pr...@mit.edu>
>>  ]]]
>>
>>  I've generally preferred this form of subject line in the small
>>  projects I've worked on, and would be very pleased to get it with
>>  a flag rather than patching commit-email.pl every time.
> 
> Looks reasonable to me.  However, instead of:
> 
>     chop(my $summary = $log[0]);
> 
> how about
> 
>     my $summary = @log ? $log[0] : '';
>     chop $summary;

Or

<bikeshed>
     my $summary = @log ? chomp($log[0]) : '';
</bikeshed>

Blair


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] commit-email.pl: support subject line based on log message

Posted by David Glasser <gl...@davidglasser.net>.
On Tue, Apr 1, 2008 at 8:08 AM, Blair Zajac <bl...@orcaware.com> wrote:
>
>
>  On Mar 31, 2008, at 10:52 PM, David Glasser wrote:
>  > On Mon, Mar 31, 2008 at 10:32 PM, Blair Zajac <bl...@orcaware.com>
>  > wrote:
>  >>
>  >> David Glasser wrote:
>  >>> On Mon, Mar 31, 2008 at 10:18 PM, Gregory Nathan Price <price@mit.edu
>  >>> > wrote:
>  >>>> On Mon, Mar 31, 2008 at 09:35:55PM -0700, David Glasser wrote:
>  >>>>> Committed in r30151; thanks for the patch!
>  >>>>
>  >>>> Excellent, thanks!
>  >>>>
>  >>>>
>  >>>>> (In the future, try create your patches at the root of trunk
>  >>>>> instead of in the subdirectory?)
>  >>>>
>  >>>> OK, will do.
>  >>>>
>  >>>>
>  >>>> I don't know much about Subversion's release practices; can this
>  >>>> change
>  >>>> wind up in some version of 1.5.x?  The same patch applies in the
>  >>>> 1.5.x
>  >>>> branch without modification, but for your convenience I've attached
>  >>>> a version from up at the root of the branch. =)
>  >>>>
>  >>>> Or maybe you have 1.5 totally feature-frozen at this point,
>  >>>> which'd be entirely reasonable.
>  >>>
>  >>> Well, we're basically frozen, but it's just a contrib script; anyone
>  >>> have a problem with nominating it for backport?
>  >>
>  >> No, go for it.
>  >
>  > Shall I interpret that as a +1?
>
>  Yes, +1.

OK, backported in r30155.

--dave

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] commit-email.pl: support subject line based on log message

Posted by Blair Zajac <bl...@orcaware.com>.
David Glasser wrote:
> On Mon, Mar 31, 2008 at 10:18 PM, Gregory Nathan Price <pr...@mit.edu> wrote:
>> On Mon, Mar 31, 2008 at 09:35:55PM -0700, David Glasser wrote:
>>  > Committed in r30151; thanks for the patch!
>>
>>  Excellent, thanks!
>>
>>
>>  > (In the future, try create your patches at the root of trunk
>>  > instead of in the subdirectory?)
>>
>>  OK, will do.
>>
>>
>>  I don't know much about Subversion's release practices; can this change
>>  wind up in some version of 1.5.x?  The same patch applies in the 1.5.x
>>  branch without modification, but for your convenience I've attached
>>  a version from up at the root of the branch. =)
>>
>>  Or maybe you have 1.5 totally feature-frozen at this point,
>>  which'd be entirely reasonable.
> 
> Well, we're basically frozen, but it's just a contrib script; anyone
> have a problem with nominating it for backport?

No, go for it.

Blair

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] commit-email.pl: support subject line based on log message

Posted by David Glasser <gl...@davidglasser.net>.
On Mon, Mar 31, 2008 at 10:18 PM, Gregory Nathan Price <pr...@mit.edu> wrote:
> On Mon, Mar 31, 2008 at 09:35:55PM -0700, David Glasser wrote:
>  > Committed in r30151; thanks for the patch!
>
>  Excellent, thanks!
>
>
>  > (In the future, try create your patches at the root of trunk
>  > instead of in the subdirectory?)
>
>  OK, will do.
>
>
>  I don't know much about Subversion's release practices; can this change
>  wind up in some version of 1.5.x?  The same patch applies in the 1.5.x
>  branch without modification, but for your convenience I've attached
>  a version from up at the root of the branch. =)
>
>  Or maybe you have 1.5 totally feature-frozen at this point,
>  which'd be entirely reasonable.

Well, we're basically frozen, but it's just a contrib script; anyone
have a problem with nominating it for backport?

--dave


-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] commit-email.pl: support subject line based on log message

Posted by Gregory Nathan Price <pr...@mit.edu>.
On Mon, Mar 31, 2008 at 09:35:55PM -0700, David Glasser wrote:
> Committed in r30151; thanks for the patch!

Excellent, thanks!

> (In the future, try create your patches at the root of trunk
> instead of in the subdirectory?)

OK, will do.


I don't know much about Subversion's release practices; can this change
wind up in some version of 1.5.x?  The same patch applies in the 1.5.x
branch without modification, but for your convenience I've attached
a version from up at the root of the branch. =)

Or maybe you have 1.5 totally feature-frozen at this point,
which'd be entirely reasonable.

Thanks,
Greg

Re: [PATCH] commit-email.pl: support subject line based on log message

Posted by David Glasser <gl...@davidglasser.net>.
On Mon, Mar 31, 2008 at 9:25 PM, Gregory Nathan Price <pr...@mit.edu> wrote:
> On Mon, Mar 31, 2008 at 03:39:44PM -0700, David Glasser wrote:
>  > 2008/3/28 Gregory Nathan Price <pr...@mit.edu>:
>
> > >  [[[
>  > >  * tools/hook-scripts/commit-email.pl.in
>  > >   Support --summary for taking subject line from log message.
>  > >
>  > >  Patch by: Greg Price <pr...@mit.edu>
>  > >  ]]]
>  >
>
> > Looks reasonable to me.  However, instead of:
>  >
>  >     chop(my $summary = $log[0]);
>  >
>  > how about
>  >
>  >     my $summary = @log ? $log[0] : '';
>  >     chop $summary;
>  >
>  > ?
>
>  Sure.  New patch attached with this change.
>
>  I also switched to chomp per the thread's further discussion, though
>  in the present code it makes no difference; from where @log is created
>  on line 368, it's clear every element ends with a newline.

Committed in r30151; thanks for the patch!  (In the future, try create
your patches at the root of trunk instead of in the subdirectory?)

--dave


-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] commit-email.pl: support subject line based on log message

Posted by Gregory Nathan Price <pr...@mit.edu>.
On Mon, Mar 31, 2008 at 03:39:44PM -0700, David Glasser wrote:
> 2008/3/28 Gregory Nathan Price <pr...@mit.edu>:
> >  [[[
> >  * tools/hook-scripts/commit-email.pl.in
> >   Support --summary for taking subject line from log message.
> >
> >  Patch by: Greg Price <pr...@mit.edu>
> >  ]]]
> 
> Looks reasonable to me.  However, instead of:
> 
>     chop(my $summary = $log[0]);
> 
> how about
> 
>     my $summary = @log ? $log[0] : '';
>     chop $summary;
> 
> ?

Sure.  New patch attached with this change.

I also switched to chomp per the thread's further discussion, though
in the present code it makes no difference; from where @log is created
on line 368, it's clear every element ends with a newline.

Greg

Re: [PATCH] commit-email.pl: support subject line based on log message

Posted by David Glasser <gl...@davidglasser.net>.
2008/3/28 Gregory Nathan Price <pr...@mit.edu>:
> This adds to commit-email.pl a flag --summary,
>  which produces subject lines like
>   r123 - Stop frobbing the veeblenitzer
>  instead of the familiar
>   r123 - in src/veeble: . nitzed
>  , copying the first line of the log message into the subject line.
>
>  [[[
>  * tools/hook-scripts/commit-email.pl.in
>   Support --summary for taking subject line from log message.
>
>  Patch by: Greg Price <pr...@mit.edu>
>  ]]]
>
>  I've generally preferred this form of subject line in the small
>  projects I've worked on, and would be very pleased to get it with
>  a flag rather than patching commit-email.pl every time.

Looks reasonable to me.  However, instead of:

    chop(my $summary = $log[0]);

how about

    my $summary = @log ? $log[0] : '';
    chop $summary;

?

--dave

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org