Re: [PATCH] Release notes: use bug titles instead of commit messages if possible

2012-05-18 Thread Ivan Timofeev

Hi Petr,

On 18.05.2012 18:13, Petr Mladek wrote:

I like it very much. The only problem is that I havn't got any title
from bugzilla :-)


LOL :)


It seems that $response->title() does not return anything here. I can't
find the title() method at
http://search.cpan.org/~gaas/HTTP-Message-6.03/lib/HTTP/Response.pm
So I am in doubts how it is supposed to work. I have tried some other
hacks but without success.


"HTTP::Response is a subclass of HTTP::Message and therefore inherits 
its methods." Actually it comes from Headers:

http://search.cpan.org/~gaas/HTTP-Message-6.03/lib/HTTP/Headers.pm


Does it somehow work for you? Could you please sens some sample
parameters that you are using?


I do:
  ~/libo/master$ ./bin/lo-commit-stat --log-suffix=bombom --bugs ./ 
--after="2012-05-16"


and it prints bug numbers, but that's a debugging info that I forgot to 
remove; and then I do


  ~/libo/master$ cat bugfixes-master-bombom.log

and it prints

  bnc#760029 floor borders were missing from 3D Charts. [Muthu Subramanian]
  fdo#40778 Remove dictionary choice when adding new entry to the 
spellchecker [Caolán McNamara]
  fdo#49921 UI: UI glitch in Find & Replace dialog - buttons invisible 
[David Tardon]


Ivan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PATCH] Release notes: use bug titles instead of commit messages if possible

2012-05-18 Thread Petr Mladek
Ivan Timofeev píše v Čt 17. 05. 2012 v 18:49 +0400:
> Hi Petr,
> 
> On 15.05.2012 22:25, Ivan Timofeev wrote:
> Hum, sorry for the delay.

No problem. Everyone is busy :-)

> Now here is my second try. Strangely, but it seems to work...

I like it very much. The only problem is that I havn't got any title
from bugzilla :-)

It seems that $response->title() does not return anything here. I can't
find the title() method at
http://search.cpan.org/~gaas/HTTP-Message-6.03/lib/HTTP/Response.pm
So I am in doubts how it is supposed to work. I have tried some other
hacks but without success.

Does it somehow work for you? Could you please sens some sample
parameters that you are using?


Best Regards,
Petr

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PATCH] Release notes: use bug titles instead of commit messages if possible

2012-05-17 Thread Ivan Timofeev

Hi Petr,

On 15.05.2012 22:25, Ivan Timofeev wrote:

I will try tomorrow.


Hum, sorry for the delay.

Now here is my second try. Strangely, but it seems to work...

Best Regards,
Ivan
>From 94236a904138d2771609344f3b428493cd6efa39 Mon Sep 17 00:00:00 2001
From: Ivan Timofeev 
Date: Thu, 17 May 2012 18:38:09 +0400
Subject: [PATCH 1/2] lo-commit-stat: use bug titles instead of commit
 messages if possible

Change-Id: I0d5bb5f593c94b039c45bde638337932fa380b55
---
 bin/lo-commit-stat |  123 
 1 file changed, 104 insertions(+), 19 deletions(-)

diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index 626d601..1f067e2 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -4,10 +4,18 @@
 #!/usr/bin/perl
 
 use strict;
+use LWP::UserAgent;
 
 my $main_repo="core";
 my @pieces=("binfilter", "dictionaries", "help", "translations");
 
+my %bugzillas = (
+fdo  => "https://bugs.freedesktop.org/";,
+bnc  => "https://bugzilla.novell.com/";,
+rhbz => "https://bugzilla.redhat.com/";,
+i=> "https://issues.apache.org/ooo/";,
+);
+
 sub search_bugs()
 {
 my ($pdata, $piece, $commit_id, $line) = @_;
@@ -214,9 +222,9 @@ sub open_log_file($)
 return $log;
 }
 
-sub print_summary_in_stat($)
+sub print_summary_in_stat()
 {
-my ($summary, $pprint_filters, $print_mode, $ppiece_title, $pflags, $pbugs, $pauthors, $prefix, $log) = @_;
+my ($summary, $pprint_filters, $ppiece_title, $pflags, $pbugs, $pauthors, $prefix, $log) = @_;
 
 return if ( $summary eq "" );
 
@@ -232,7 +240,7 @@ sub print_summary_in_stat($)
 return unless (defined $print);
 
 # print piece title if not done yet
-if ( defined ${$ppiece_title} && $print_mode ne "bugnumbers" ) {
+if ( defined ${$ppiece_title} ) {
 printf $log "${$ppiece_title}\n";
 ${$ppiece_title} = undef;
 }
@@ -240,11 +248,7 @@ sub print_summary_in_stat($)
 # finally print the summary line
 my $bugs = "";
 if ( %{$pbugs} ) {
-if ( $print_mode eq "bugnumbers" ) {
-$bugs = join ("\n", keys %{$pbugs}) . "\n";
-} else {
-$bugs = " (" . join (", ", keys %{$pbugs}) . ")";
-}
+$bugs = " (" . join (", ", keys %{$pbugs}) . ")";
 }
 
 my $authors = "";
@@ -252,16 +256,12 @@ sub print_summary_in_stat($)
 $authors = " [" . join (", ", keys %{$pauthors}) . "]";
 }
 
-if ( $print_mode eq "bugnumbers" ) {
-printf $log $bugs;
-} else {
-printf $log $prefix . $summary . $bugs . $authors . "\n";
-}
+printf $log $prefix . $summary . $bugs . $authors . "\n";
 }
 
-sub print_stat()
+sub print_stat($$$)
 {
-my ($pdata, $pprint_filters, $print_mode, $log) = @_;
+my ($pdata, $pprint_filters, $log) = @_;
 
 foreach my $piece ( sort { $a cmp $b } keys %{$pdata}) {
 # check if this piece has any entries at all
@@ -274,7 +274,7 @@ sub print_stat()
 foreach my $id ( sort { $pdata->{$piece}{$a}{'summary'} cmp $pdata->{$piece}{$b}{'summary'} } keys %{$pdata->{$piece}}) {
 my $summary = $pdata->{$piece}{$id}{'summary'};
 if ($summary ne $old_summary) {
-print_summary_in_stat($old_summary, $pprint_filters, $print_mode, \$piece_title, \%flags, \%bugs, \%authors, "+ ", $log);
+print_summary_in_stat($old_summary, $pprint_filters, \$piece_title, \%flags, \%bugs, \%authors, "+ ", $log);
 $old_summary = $summary;
 %authors = ();
 %bugs = ();
@@ -294,9 +294,87 @@ sub print_stat()
 $flags{$flag} = 1;
 }
 }
-print_summary_in_stat($old_summary, $pprint_filters, $print_mode, \$piece_title, \%flags, \%bugs, \%authors, "+ ", $log);
+print_summary_in_stat($old_summary, $pprint_filters, \$piece_title, \%flags, \%bugs, \%authors, "+ ", $log);
+}
+}
+}
+
+sub get_bug_name($$)
+{
+my ($bug, $summary) = @_;
+print "$bug\n";
+
+$bug =~ m/(?:(\w*)\#+(\d+))/; # fdo#12345
+my $bugzilla = $1;# fdo
+my $bug_number = $2;  # 12345
+
+if ( $bugzillas{$bugzilla} ) {
+my $url = $bugzillas{$bugzilla} . "show_bug.cgi?id=" . $bug_number;
+my $ua = LWP::UserAgent->new;
+$ua->timeout(10);
+$ua->env_proxy;
+my $response = $ua->get($url);
+if ($response->is_success) {
+my $title = $response->title();
+if ( $title =~ s/^Bug \d+ – // ) {
+return $title;
+}
+}
+}
+
+return $summary;
+}
+
+sub print_bugs($$)
+{
+my ($pdata, $log) = @_;
+
+# associate bugs with their summaries and fixers
+my %bugs = ();
+foreach my $piece ( keys %{$pdata}) {
+foreach my $id ( keys %{$pdata->{$piece}}) {
+foreach my $bug (ke

Re: [PATCH] Release notes: use bug titles instead of commit messages if possible

2012-05-15 Thread Ivan Timofeev

Hi Petr,

On 15.05.2012 14:17, Petr Mladek wrote:

+ some commits fix more bugs; your solution returns summary of
   the last one
+ there might be more commits for the same bug; you might get
   more exactly same lines


Yes.
(also there might be reverts, so that an old fix was reverted and a new 
fix is still not ready... *shudder* But that is very unlikely.)



What about the following solution?


Sounds good :)


Would you like to look at it? If you do not feel like, I could do the
refactoring myself.


Sorry, I cannot even load this small script into the brain this evening. 
*inane smile* I will try tomorrow.



You already did the great job to find how to get
bugzilla titles.


Ah, simple googling, as usual... I found an example here: 
http://search.cpan.org/~gaas/libwww-perl-6.04/lib/LWP/UserAgent.pm


Regards,
Ivan
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [PATCH] Release notes: use bug titles instead of commit messages if possible

2012-05-15 Thread Petr Mladek
Hi Ivan,

It is great idea. I am sorry for the late replay. I have somehow missed
this mail.

Ivan Timofeev píše v Čt 10. 05. 2012 v 21:04 +0400:
> Hi,
> 
> looking at our release notes
>http://wiki.documentfoundation.org/Releases/3.5.3/RC1
> I think it is confusing for users to see the git commit messages there.
> For example:
>clrContourCache for SwAnchoredDrawObjects (fdo#45376) [Andreas Schierl]

I fully agree.

> What about using the bug names? Mozilla does the same:
> http://www.mozilla.org/en-US/firefox/11.0/releasenotes/buglist.html

Yup, such list of fixed bugs makes perfect sense.

> The rough patch for bin/lo-commit-stat is attached. (But please note, 
> that I am an absolute Perl n00b. :)
> Unfortunately it does not work with Novell bugzilla. :(
> 
> Refusals? Thoughts? Advices?

The first draft is cool! I would just slightly modify the logic. I see
the following problems:

+ some commits fix more bugs; your solution returns summary of
  the last one
+ there might be more commits for the same bug; you might get
  more exactly same lines
+ sometimes the bug description is lame as well :-)

What about the following solution? lo-commit-stat already has three
basic modes where it prints:

+ all commit messages by default
+ only commit massages with bug numbers when used --bugs
+ only bug numbers when used --bug-numbers

I would leave the default mode as is. I would rework --bugs mode to
behave more like the --bug-numbers mode. It should print all bug numbers
together with the messages from bugzilla. If you are not able to get the
bug title, it might print the commit message instead.

Hmm, the current --bug-numbers mode is an ugly quick hack. It does not
look for duplicates. It would be better to rewrite it a bit. I would put
bug numbers into a hash in load_git_log(). Then you could implement
print_bugs() instead of print_stat() and just go though this hash and
print it different way (one line per bug instead of one line per
commit).

How does that sound?

Would you like to look at it? If you do not feel like, I could do the
refactoring myself. You already did the great job to find how to get
bugzilla titles.


Best Regards,
Petr

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Release notes: use bug titles instead of commit messages if possible

2012-05-10 Thread Ivan Timofeev

Hi,

looking at our release notes
  http://wiki.documentfoundation.org/Releases/3.5.3/RC1
I think it is confusing for users to see the git commit messages there.
For example:
  clrContourCache for SwAnchoredDrawObjects (fdo#45376) [Andreas Schierl]

What about using the bug names? Mozilla does the same:
http://www.mozilla.org/en-US/firefox/11.0/releasenotes/buglist.html

The rough patch for bin/lo-commit-stat is attached. (But please note, 
that I am an absolute Perl n00b. :)

Unfortunately it does not work with Novell bugzilla. :(

Refusals? Thoughts? Advices?

Thanks,
Ivan


0001-lo-commit-stat-use-bug-titles-instead-of-commit-mess.patch
Description: application/mbox
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice