projects
/
bak-git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3900627
)
make bak grep same as git grep, bak log-grep to filter logs
master
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 11 Aug 2022 13:48:49 +0000
(15:48 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 11 Aug 2022 13:48:49 +0000
(15:48 +0200)
bak-git-server.pl
patch
|
blob
|
history
diff --git
a/bak-git-server.pl
b/bak-git-server.pl
index
b4c7eec
..
3bd5f63
100755
(executable)
--- a/
bak-git-server.pl
+++ b/
bak-git-server.pl
@@
-27,6
+27,8
@@
bak command, overview:
bak diff [host:][/path]
bak status [/path]
bak log [/path]
bak diff [host:][/path]
bak status [/path]
bak log [/path]
+ bak log-grep pattern
+ bak grep pattern
bak show
bak ch[anges]
bak show
bak ch[anges]
@@
-182,7
+184,7
@@
while (my $client = $server->accept()) {
chomp($line);
my $peerhost = $client->peerhost;
chomp($line);
my $peerhost = $client->peerhost;
- if ( $peerhost !~ m/^(10\.13\.37\.|10\.60\.0\.)/ ) {
+ if ( $peerhost !~ m/^(10\.13\.37\.|10\.60\.0\.
|10\.200\.100\.
)/ ) {
print $client "$peerhost not allowed\n";
next;
}
print $client "$peerhost not allowed\n";
next;
}
@@
-284,8
+286,10
@@
while (my $client = $server->accept()) {
print $client `ls $file_path 2>&1`;
} elsif ( $command eq 'show' ) {
print $client `git show $rel_path`;
print $client `ls $file_path 2>&1`;
} elsif ( $command eq 'show' ) {
print $client `git show $rel_path`;
+ } elsif ( $command eq 'log-grep' ) {
+ #print $client `git log -g --grep=$rel_path`;
} elsif ( $command eq 'grep' ) {
} elsif ( $command eq 'grep' ) {
- print $client `git
log -g --grep=
$rel_path`;
+ print $client `git
grep
$rel_path`;
} elsif ( $command eq 'find' ) {
print $client `find . -iname '*$rel_path*' | sed -e 's,^./,,' -e 's,/,:/,'`
} elsif ( $command eq 'link' ) {
} elsif ( $command eq 'find' ) {
print $client `find . -iname '*$rel_path*' | sed -e 's,^./,,' -e 's,/,:/,'`
} elsif ( $command eq 'link' ) {