blob: 58326a217d914d63b74e53652c6c18f4c9e408a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/bin/sh
# git-s -- selection-friendly git-status
git status --porcelain | perl -ne '
push @{$x{$1}}, $2 if /^(.). (.*)/;
push @{$y{$1}}, $2 if /^.(.) (.*)/;
END {
delete $x{"?"}; delete $x{" "}; delete $y{" "};
for (["index" => \%x], ["tree" => \%y]) {
($n, $h) = @$_;
print "$n:" if values %$h;
for (sort keys %$h) {
print " $_ ";
print " $_" for @{$h->{$_}};
print "\n";
}
}
}
'
|