21 replace => $+{replace},
22 want => $+{want} eq '+'
40 want => $+{want} eq '+'
50 want => $+{want} eq '+'
55 die "Usage: $0 filterexpression filterexpression..., where a filter expression is of the form +s/search/replace/, +m/search/, +, -s/search/replace/, -m/search/, -";
61 my ($str, @args) = @_;
62 $str =~ s{\\([1-9])|(\&)|(\\)\\}{
63 $1 ? $args[$1] : $2 ? $args[0] : $3
68 my $current_output = $ENV{output};
74 my ($search, $replace, $want) = ($_->{search}, $_->{replace}, $_->{want});
76 if($fn =~ s/$search/defined $replace ? fillin $replace, $&, map { substr($s, $-[$_], $+[$_] - $-[$_]) } 0..(@+ - 1) : $&/se)
78 $fn = $s unless $want;
86 open my $infh, '-|', 'git', 'ls-files', '-s';
93 /^(\d+) ([0-9a-f]+) (\d+)\t(.*)$/ or die "invalid index line: $_";
94 my ($mode, $hash, $stageno, $filename) = ($1, $2, $3, $4);
95 my ($filename_new, $want) = filter($filename);
98 $idx .= "0 0000000000000000000000000000000000000000 $stageno\t$filename\n"
99 if $filename ne $filename_new;
100 $idx .= "$mode $hash $stageno\t$filename_new\n";
105 $idx .= "0 0000000000000000000000000000000000000000 $stageno\t$filename\n";
110 or die "git-ls-files: $!";
112 print "$plus:$minus\n";
114 open my $outfh, ">", "/tmp/idxtest";
118 open my $outfh, '|-', 'git', 'update-index', '--index-info';
121 or die "git-update-index: $!";