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

Re: [PATCH] Do not print log separator in contribulyze.

From: Senthil Kumaran S <senthil_at_collab.net>
Date: Wed, 16 Jul 2008 20:47:06 +0530

Hi Karl,

Karl Fogel wrote:
> It's okay to include that IRC transcript in your log message, to give
> the reader an understanding of what motivates the change.

Updated the log message, but I am not sure whether this is the right way to
include IRC transcript. I used kf-irc-prettify
(http://svn.red-bean.com/repos/kfogel/trunk/.emacs) and some manual edition in
order to format the IRC log message.

[[[
Do not print log separator in contribulyze.

* tools/dev/contribulyze.py
   (graze): If there is no final newline at the end of a log message,
    move to the next log message.

IRC transcript:
     danielsh: stylesen: morning :) what was the purpose of the propedits
      you did this afternoon?

     Arfrever: danielsh: I guess that he added missing lines at the end
      of log messages.

     stylesen: danielsh: Good night :) they did not have a final n
      line, which appeared a bit ugly when I did 'svn log | less' on the
      1.5.x branch, but later after 2 or 3 revisions I realized, there
      are lot of log messages like that, so stopped after 2 or 3 revisions!

     danielsh: stylesen: ah, thanks.

     ***danielsh has autocmd FileType svn set noendofline...
      (English: all my log messages don't have terminating newline)

     stylesen: danielsh: A basic problem when we dont have final n
      line is in contriubulize where after the log message the
      '--------------' line also appears in the listing

     danielsh: stylesen: it's a bug in contribulyze.py, then.

     stylesen: danielsh: okie will fix it :)

     danielsh: stylesen: cool :)

Patch by: stylesen
]]]

> I'm confused, though: your log messages says "If there is no '\n' ... do
> not print the log separator". But then your code change does something
> else: it *replaces* the encountered log_separator with a newline. How
> does it avoid combining two log messages into one? The patch never sets
> 'just_saw_separator' or does any of the other "we just encountered a
> boundary" stuff... However, when I tested, I didn't see any log entries
> get combined, so it might be that your patch is correct and I just don't
> understand why :-).

That was a quick fix :) and I found a new bug in that, thanks for pointing it
out ie., if there is a log message immediately after the log message which has
no final newline, then we don't get the log message following it (the log
message without final newline).

For example:
------------------------------------------------------------------------
r31726 | cmpilato | 2008-06-13 18:19:34 +0530 (Fri, 13 Jun 2008) | 8 lines
Changed paths:
    M /trunk/Makefile.in

Make install-javahl depend on javahl.

* Makefile.in
   (install-javahl): Add javahl as a dependency for installing javahl. This
     ensures building javahl before we install.

Patch by: stylesen
------------------------------------------------------------------------
r21246 | cmpilato | 2006-08-24 21:06:57 +0530 (Thu, 24 Aug 2006) | 13 lines
Changed paths:
    M /trunk/contrib/hook-scripts/svn2feed.py

Place item author and date information in feed metadata.

* contrib/hook-scripts/svn2feed.py
   (global): Remove the TODO item.
   (Svn2Feed._get_item_dict): Remove the date information from desc to
     avoid redundancy. Strip the newline and store the author information
     in data structure.
   (Svn2Feed._format_update_ts): New helper function.
   (Svn2RSS._make_rss_item): Pass author information to RSSItem function.
   (Svn2Atom._make_atom_item): Create a new tag for author and append it
     to the entry.

Patch by: Bhuvaneswaran Arumugam <bhuvan_at_collab.net>
------------------------------------------------------------------------

In the above log message r21246 will not appear in the output as per my first
patch.

> But in any case, when I tried to reproduce the bug without your patch, I
> couldn't. Could you give a formal reproduction recipe?

This is because in your log-data.in for every log message which did not have a
final newline you had something like "(some text)" at the end which is handled
by the following code:

<snip>
                 line = input.readline()
                 log.accum(line)
                 num_lines -= 1
                 m = in_field_re.match(line)
                 if not m:
                   m = field_re.match(line)
                   if not m:
                     aside_match = parenthetical_aside_re.match(line)
                     if aside_match:
                       field.add_endum(line)
                   log.add_field(field)
                   field = None
</snip>

Note the "parenthetical_aside_re.match(line)" above which prevented you from
reproducing this issue.

Now with my updated patch attached we do not get log separator printed and
other functionalities are working fine.

Steps to reproduce (run with and without the updated patch and observe
stylesen's logs):

        $ cd tools/dev
        $ ./contribulyze.py -C ../../COMMITTERS < log-data.in

log-data contents are as follows:

------------------------------------------------------------------------
r32124 | pburba | 2008-07-15 10:04:04 -0400 (Tue, 15 Jul 2008) | 2 lines

This is a fake log message for r32124, to test out contribulyze.py.

------------------------------------------------------------------------
r32123 | sunny256 | 2008-07-15 06:13:49 -0400 (Tue, 15 Jul 2008) | 4 lines

This is a fake log message for r32123, to test out contribulyze.py.

Patch by: J. Random Contributor <jrandom_at_example.com>
(Tweaked by me. Look, this log msg doesn't have its own final newline!)
------------------------------------------------------------------------
r32122 | pburba | 2008-07-14 21:25:56 -0400 (Mon, 14 Jul 2008) | 5 lines

This is a fake log message for r32122, to test out contribulyze.py.

Patch by: Some Other Contributor <anotherone_at_example.com>
(Tweaked by me. This log msg does have its own final newline.)

------------------------------------------------------------------------
r32121 | pburba | 2008-07-14 20:47:11 -0400 (Mon, 14 Jul 2008) | 3 lines

This is a fake log message for r32121, to test out contribulyze.py.

Patch by: stylesen
------------------------------------------------------------------------
r32120 | pburba | 2008-07-14 20:39:58 -0400 (Mon, 14 Jul 2008) | 2 lines

This is a fake log message for r32120, to test out contribulyze.py.

------------------------------------------------------------------------
r32119 | pburba | 2008-07-14 19:37:15 -0400 (Mon, 14 Jul 2008) | 2 lines

This is a fake log message for r32119, to test out contribulyze.py.

------------------------------------------------------------------------

Thank You.

-- 
Senthil Kumaran S
http://www.stylesen.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-07-16 17:17:29 CEST

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.