diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-10-31 01:44:13 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-10-31 01:44:13 -0400 |
| commit | 301befabbc9ab4caebe216a046615dbc54d14987 (patch) | |
| tree | aa71c32cc525cd6b862b1a85906c2a05a9cdfda6 | |
| parent | 40182fa3fa29554a2e305db9a5c4a7deeb1399d8 (diff) | |
| download | greypool-301befabbc9ab4caebe216a046615dbc54d14987.tar.gz | |
ropeylog: do not chdir().
| -rwxr-xr-x | ropeylog | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -139,7 +139,7 @@ sub read_info_file { my $maint; my $email; - open my $f, "<$file" or die $!; + open my $f, "<$git_root/$file" or die $!; while(<$f>) { chomp; @@ -156,9 +156,7 @@ sub read_info_file { } sub parse_info_files { - my $olddir = getcwd(); - chdir($git_root) or die "$!"; - my $files = `git ls-files '*/*/*.info'`; + my $files = `git $git_args ls-files '*/*/*.info'`; for my $info (split /\n/, $files) { $total_builds++; my ($maintainer, $email) = read_info_file($info); @@ -172,15 +170,15 @@ sub parse_info_files { $lastgitdate{$maintainer} = $lastgithash{$maintainer} = 0; push @{$maintbuilds{$maintainer}}, $catbuild; } - chdir($olddir); @maintainers = keys %name2email; } sub get_git_maintainers { - my $olddir = getcwd(); - chdir($git_root) or die "$!"; - open my $in, "git log --pretty=format:%h%x09%an%x09%ae%x09%as%x09%s|" or die $!; + open my $in, "git $git_args log " . + "--pretty=format:%h%x09%an%x09%ae%x09%as%x09%s|" + or die $!; + while(<$in>) { chomp; my ($hash, $name, $email, $date, $catbuild, undef) = split /\t/, $_, 6; @@ -192,7 +190,6 @@ sub get_git_maintainers { } } close $in; - chdir($olddir); } ############### @@ -378,6 +375,8 @@ sub print_all_reports { $cache_dir = "$ENV{HOME}/.$SELF"; system("mkdir -p $cache_dir"); +$git_args = "--work-tree $git_root --git-dir $git_root/.git"; + if(@ARGV) { if($ARGV[0] eq '-d') { shift; |
