[Libreoffice-commits] .: 3 commits - bin/lo-commit-stat

Petr Mladek pmladek at kemper.freedesktop.org
Tue Apr 26 11:23:38 PDT 2011


 bin/lo-commit-stat |   45 +++++++++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 18 deletions(-)

New commits:
commit bf1c8d449cdf97b09e3e2db10db03165ffaaa52a
Author: Andras Timar <atimar at novell.com>
Date:   Tue Apr 19 18:42:53 2011 +0200

    fix typos in messages

diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index 132b9a8..2b5b9b8 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -39,7 +39,7 @@ sub search_bugs($$$$)
         $line =~ s/\s*-\s*$bug_orig\s*//;
         $line =~ s/\(?$bug_orig\)?[:,]?\s*//;
 
-        # bnc# is prefered over n# for novell bugs
+        # bnc# is preferred over n# for novell bugs
         $bug =~ s/^n\#/bnc#/;
         # save the bug number
         %{$pdata->{$piece}{$commit_id}{'bugs'}} = () if (! defined %{$pdata->{$piece}{$commit_id}{'bugs'}});
@@ -120,7 +120,7 @@ sub load_git_log($$$$$)
         }
 
         $line = search_bugs($pdata, $piece, $commit_id, $line);
-        # FIXME: need to be implemeted
+        # FIXME: need to be implemented
 #        search_keywords($pdata, $line);
 
         unless (defined $pdata->{$piece}{$commit_id}{'summary'}) {
@@ -203,7 +203,7 @@ sub open_log_file($$$$)
 
     if (-f $logfilename) {
         print "WARNING: The log file already exists: $logfilename\n";
-        print "Do you want to ovewrite it? (Y/n)?\n";
+        print "Do you want to overwrite it? (Y/n)?\n";
         my $answer = <STDIN>;
         chomp $answer;
         $answer = "y" unless ($answer);
@@ -258,7 +258,7 @@ sub print_stat($$$)
     my ($pdata, $pprint_filters, $log) = @_;
 
     foreach my $piece ( sort { $a cmp $b } keys %{$pdata}) {
-        # check if this peice has any entries at all
+        # check if this piece has any entries at all
         my $piece_title = "+ $piece";
         if ( %{$pdata->{$piece}} ) {
             my $old_summary="";
@@ -305,10 +305,10 @@ sub usage()
           "Options:\n" .
           "     --help          print this help\n" .
           "     --no-pieces     read changes just from the main repository, ignore other cloned repos\n" .
-          "     --piece=<piece> summarize just chnages from the given piece\n" .
+          "     --piece=<piece> summarize just changes from the given piece\n" .
           "     --log-suffix=<string> suffix of the log file name; the result will be\n" .
           "                     commit-log-<branch>-<log-name-suffix>.log; the branch name\n" .
-          "                     is detected autoamtically\n" .
+          "                     is detected automatically\n" .
           "     --bugs          print just bug fixes\n" .
           "     --rev-list      use \"git rev-list\" instead of \"git log\"; useful to check\n" .
           "                     differences between branches\n" .
@@ -317,7 +317,7 @@ sub usage()
           "      git_arg        extra parameters passed to the git command to define\n" .
           "                     the area of interest; The default command is \"git log\" and\n" .
           "                     parameters might be, for example, --after=\"2010-09-27\" or\n" .
-          "                     TAG..HEAD; with the option --rev-list, useful might be, for,\n" .
+          "                     TAG..HEAD; with the option --rev-list, useful might be, for\n" .
           "                     example origin/master ^origin/libreoffice-3-3\n";
 }
 
@@ -366,7 +366,7 @@ foreach my $arg (@ARGV) {
 
 $git_command .= " " . join ' ', @git_args if (@git_args);
 
-(defined $top_dir) || die "Error: top direcotry is not defined\n";
+(defined $top_dir) || die "Error: top directory is not defined\n";
 (-d "$top_dir") || die "Error: not a directory: $top_dir\n";
 (-f "$top_dir/.git/config") || die "Error: can't find $top_dir/.git/config\n";
 
commit d69a264fd831a9f6385083ab9b28626ef3582157
Author: Petr Mladek <pmladek at suse.cz>
Date:   Wed Apr 13 16:10:45 2011 +0200

    lo-commit-stat: add --rev-list option
    
    + use "git log" again to get weekly commit logs
    + use "git rev-list" only with --rev-list option; useful to list differences
      between branches

diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index 111127e..132b9a8 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -69,9 +69,9 @@ sub standardize_summary($)
 
 sub load_git_log($$$$$) 
 {
-    my ($pdata, $repo_dir, $piece, $branch_name, $pgit_args) = @_;
+    my ($pdata, $repo_dir, $piece, $branch_name, $git_command) = @_;
 
-    my $cmd = "cd $repo_dir && git rev-list --pretty=medium " . join ' ', @{$pgit_args};
+    my $cmd = "cd $repo_dir; $git_command";
     my $commit_id;
     my $summary;
 
@@ -153,7 +153,7 @@ sub get_repo_name($)
 
 sub load_data($$$$$)
 {
-    my ($pdata, $top_dir, $piece, $branch_name, $pgit_args) = @_;
+    my ($pdata, $top_dir, $piece, $branch_name, $git_command) = @_;
 
     if (defined $piece) {
         my $piece_dir;
@@ -162,11 +162,11 @@ sub load_data($$$$$)
         } else {
             $piece_dir = "$top_dir/clone/$piece";
         }
-        load_git_log($pdata, $piece_dir, $piece, $branch_name, $pgit_args);
+        load_git_log($pdata, $piece_dir, $piece, $branch_name, $git_command);
     } else {
-        load_git_log($pdata, $top_dir, $main_repo, $branch_name, $pgit_args);
+        load_git_log($pdata, $top_dir, $main_repo, $branch_name, $git_command);
         foreach my $piece (@pieces) {
-            load_git_log($pdata, "$top_dir/clone/$piece", $piece, $branch_name, $pgit_args);
+            load_git_log($pdata, "$top_dir/clone/$piece", $piece, $branch_name, $git_command);
         }
     }
 }
@@ -300,7 +300,7 @@ sub usage()
 {
     print "This script generates LO git commit summary\n\n" .
           
-          "Usage: lo-commit-stat [--help] [--no-pieces] [--piece=<piece>] --log-suffix=<string> topdir [git_log_param...]\n\n" .
+          "Usage: lo-commit-stat [--help] [--no-pieces] [--piece=<piece>] --log-suffix=<string> topdir [git_arg...]\n\n" .
 
           "Options:\n" .
           "     --help          print this help\n" .
@@ -310,11 +310,15 @@ sub usage()
           "                     commit-log-<branch>-<log-name-suffix>.log; the branch name\n" .
           "                     is detected autoamtically\n" .
           "     --bugs          print just bug fixes\n" .
+          "     --rev-list      use \"git rev-list\" instead of \"git log\"; useful to check\n" .
+          "                     differences between branches\n" .
           "      topdir         directory with the libreoffice/bootstrap clone; the piece repos\n" .
           "                     must be cloned in the main-repo-root/clone/<piece> subdirectories\n" .
-          "      git_log_param  extra parameters passed to the git log command to define\n" .
-          "                     the area of interest , e.g. --after=\"2010-09-27\" or\n" .
-          "                     TAG..HEAD or origin/master ^origin/libreoffice-3-3";
+          "      git_arg        extra parameters passed to the git command to define\n" .
+          "                     the area of interest; The default command is \"git log\" and\n" .
+          "                     parameters might be, for example, --after=\"2010-09-27\" or\n" .
+          "                     TAG..HEAD; with the option --rev-list, useful might be, for,\n" .
+          "                     example origin/master ^origin/libreoffice-3-3\n";
 }
 
 
@@ -331,6 +335,7 @@ my $log_prefix = "commit-log";
 my $log_suffix;
 my $log;
 my $branch_name;
+my $git_command = "git log";
 my @git_args;
 my %data;
 my %print_filters = ();
@@ -348,6 +353,8 @@ foreach my $arg (@ARGV) {
     } elsif ($arg eq '--bugs') {
         $print_filters{'bug'} = 1;
         $log_prefix = "bugfixes"
+    } elsif ($arg eq '--rev-list') {
+        $git_command = "git rev-list --pretty=medium"
     } else {
         if (! defined $top_dir) {
             $top_dir=$arg;
@@ -357,6 +364,8 @@ foreach my $arg (@ARGV) {
     }
 }
 
+$git_command .= " " . join ' ', @git_args if (@git_args);
+
 (defined $top_dir) || die "Error: top direcotry is not defined\n";
 (-d "$top_dir") || die "Error: not a directory: $top_dir\n";
 (-f "$top_dir/.git/config") || die "Error: can't find $top_dir/.git/config\n";
@@ -365,7 +374,7 @@ foreach my $arg (@ARGV) {
 
 $branch_name = get_branch_name($top_dir);
 
-load_data(\%data, $top_dir, $piece, $branch_name, \@git_args);
+load_data(\%data, $top_dir, $piece, $branch_name, $git_command);
 
 $log = open_log_file($log_prefix, $log_suffix, $top_dir, $branch_name);
 print_stat(\%data, \%print_filters, $log);
commit e4b579836bea8e7f3498416cfd493d8a4c633eb5
Author: Petr Mladek <pmladek at suse.cz>
Date:   Mon Apr 11 17:09:34 2011 +0200

    lo-commit-stat: allow to list commits between branches
    
    use "git rev-list --pretty=medium" instead of "git log"
    to be able to use origin/libreoffice-3-4 ^origin/libreoffice-3-3
    to generate list of changes that are in 3.4 but not in 3.3

diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index 9a13097..111127e 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -71,7 +71,7 @@ sub load_git_log($$$$$)
 {
     my ($pdata, $repo_dir, $piece, $branch_name, $pgit_args) = @_;
 
-    my $cmd = "cd $repo_dir && git log " . join ' ', @{$pgit_args};
+    my $cmd = "cd $repo_dir && git rev-list --pretty=medium " . join ' ', @{$pgit_args};
     my $commit_id;
     my $summary;
 
@@ -314,7 +314,7 @@ sub usage()
           "                     must be cloned in the main-repo-root/clone/<piece> subdirectories\n" .
           "      git_log_param  extra parameters passed to the git log command to define\n" .
           "                     the area of interest , e.g. --after=\"2010-09-27\" or\n" .
-          "                     TAG..HEAD";
+          "                     TAG..HEAD or origin/master ^origin/libreoffice-3-3";
 }
 
 


More information about the Libreoffice-commits mailing list