diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-05-31 10:46:15 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-05-31 10:46:15 +0200 |
commit | 6a29b48bf54df5a674f37c49578a94211a1d5984 (patch) | |
tree | 886eab375290a030db268c6aa925a0fedd4c36f0 /bin/lo-commit-stat | |
parent | 07c1d34ec78dd6e980c4ae370042ab5e3870aa0b (diff) | |
parent | 29a2abb9a3612bcef6a42e11caf52b16b774178a (diff) |
Merge branch 'master' of git://anongit.freedesktop.org/libreoffice/bootstrap
Diffstat (limited to 'bin/lo-commit-stat')
-rwxr-xr-x | bin/lo-commit-stat | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat index 8de4d3109642..24bcb891bc22 100755 --- a/bin/lo-commit-stat +++ b/bin/lo-commit-stat @@ -195,11 +195,12 @@ sub get_branch_name($) return $branch; } -sub open_log_file($$$$) +sub open_log_file($$$$$) { - my ($log_prefix, $log_suffix, $top_dir, $branch_name) = @_; + my ($log_dir, $log_prefix, $log_suffix, $top_dir, $branch_name) = @_; my $logfilename = "$log_prefix-$branch_name-$log_suffix.log"; + $logfilename = "$log_dir/$logfilename" if (defined $log_dir); if (-f $logfilename) { print "WARNING: The log file already exists: $logfilename\n"; @@ -308,12 +309,13 @@ 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_arg...]\n\n" . + "Usage: lo-commit-stat [--help] [--no-pieces] [--piece=<piece>] --log-dir=<dir> --log-suffix=<string> topdir [git_arg...]\n\n" . "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 changes from the given piece\n" . + " --log-dir=<dir> directory where to put the generated log\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 automatically\n" . @@ -341,6 +343,7 @@ sub usage() my $piece; my $top_dir; my $log_prefix = "commit-log"; +my $log_dir; my $log_suffix; my $log; my $branch_name; @@ -361,6 +364,8 @@ foreach my $arg (@ARGV) { $piece = $1; } elsif ($arg =~ m/--log-suffix=(.*)/) { $log_suffix = "$1"; + } elsif ($arg =~ m/--log-dir=(.*)/) { + $log_dir = "$1"; } elsif ($arg eq '--bugs') { $print_filters{'bug'} = 1; $log_prefix = "bugfixes" @@ -385,12 +390,14 @@ $git_command .= " " . join ' ', @git_args if (@git_args); (-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"; +(!defined $log_dir) || (-d $log_dir) || die "Error: directory does no exist: $log_dir\n"; + (defined $log_suffix) || die "Error: define log suffix using --log-suffix=<string>\n"; $branch_name = get_branch_name($top_dir); load_data(\%data, $top_dir, $piece, $branch_name, $git_command); -$log = open_log_file($log_prefix, $log_suffix, $top_dir, $branch_name); +$log = open_log_file($log_dir, $log_prefix, $log_suffix, $top_dir, $branch_name); print_stat(\%data, \%print_filters, $print_mode, $log); close $log; |