added --summary to log output, fix commit rsync
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 17 Feb 2010 23:12:08 +0000 (00:12 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 17 Feb 2010 23:12:08 +0000 (00:12 +0100)
server.pl

index b6194e2..a481086 100755 (executable)
--- a/server.pl
+++ b/server.pl
@@ -84,11 +84,12 @@ while (my $client = $server->accept()) {
                system 'rsync', '-avv', "root\@$ip:$path", "$ip/$path";
                system 'git', 'add', "$ip/$path";
        } elsif ( $command eq 'commit' ) {
-               system 'rsync', '-avv', "root\@$ip:$path", "$ip/$path";
+               system 'rsync', '-avv', "root\@$ip:$path", "$ip/$path" if $path;
                $message ||= "$command $ip $path";
                system 'git', 'commit', '-m', $message, "$ip/$path";
        } elsif ( $command =~ m{(diff|status|log)} ) {
-               print $client `git $command $ip`;
+               my $opt = '--summary' if $command eq 'log';
+               print $client `git $command $opt $ip`;
        } else {
                print $client "Unknown command: $command\n";
        }