X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=bak-git-server.pl;h=f25e92643d8ad19dae195d5fdad961ad5446ef86;hb=da9db4066f08905f177fdbee51a9abb9ba5cf3c6;hp=1a074da86f45aec338521c48443d6f16efae0271;hpb=f2df934d2b8e62ae1b3b3f16679baa18abbf77af;p=bak-git.git diff --git a/bak-git-server.pl b/bak-git-server.pl index 1a074da..f25e926 100755 --- a/bak-git-server.pl +++ b/bak-git-server.pl @@ -97,14 +97,14 @@ while (my $client = $server->accept()) { my $line = <$client>; chomp($line); warn "<<< $line\n"; - my ($user,$hostname,$pwd,$command,$rel_path,$message) = split(/\s+/,$line,5); + my ($user,$hostname,$pwd,$command,$rel_path,$message) = split(/\s+/,$line,6); my $on_host = $1 if $rel_path =~ s/^([^:]+):(.+)$/$2/ && -e $1; my $path = $rel_path =~ m{^/} ? $rel_path : "$pwd/$rel_path"; - $message ||= ''; - warn "$hostname [$command] $path | $message\n"; - $message ||= "$hostname [$command] $path"; + warn "$hostname [$command] $on_host:$path | $message\n"; + $message ||= "$path [$command]"; + $message = "$hostname: $message"; my $dir = $path; $dir =~ s{/[^/]+$}{}; @@ -136,7 +136,7 @@ while (my $client = $server->accept()) { pull_changes $hostname if $command eq 'diff'; if ( $on_host ) { system 'rsync', '-avv', "root\@$on_host:$path", "$on_host/$path"; - open(my $diff, '-|', "diff -uw $hostname$path $on_host$path"); + open(my $diff, '-|', "diff -Nuw $hostname$path $on_host$path"); while(<$diff>) { print $client $_; }