5 #print STDERR join(" ",@_),"\n";
6 return system(@_) == 0;
11 if((!$dir) or (!-d
$dir)) {
12 print STDERR
"[ignored] path note exists $dir\n";
15 if(! -d
"$dir/.git") {
16 print STDERR
"[ignored] $dir not a git working tree\n";
19 print STDERR
"processing $dir (s/$exp/g) \n";
21 chdir $dir or die("$!\n");
23 open FI
,"-|",qw
/git remote/,"-v" or die("$!\n");
26 if(m/^\s*([^\s]+)\s+([^\s]+)\s+\(fetch\)\s*$/) {
31 print STDERR
"Get remotes [",scalar(keys %remotes), "]:\n";
32 print STDERR
join("\n",map {"$_ = $remotes{$_}"} keys %remotes),"\n";
33 foreach my $host (keys %remotes) {
34 my $_ = $remotes{$host};
36 if($_ eq $remotes{$host}) {
37 print STDERR
"[$host] doesn't change\n";
40 print STDERR
"[$host] => $_\n";
41 run
('git','remote','rm',$host);
42 run
('git','remote','add',$host,$_);
43 run
('git','fetch',$host,'--verbose');
50 push @ARGV,"." unless(@ARGV);
56 print STDERR
"Usage:\n$0 <text/replacement> git_working_tree [git_working_tree...]\n"