multiple commands add,commit on same path
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 25 Jun 2012 14:49:54 +0000 (16:49 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 25 Jun 2012 14:49:59 +0000 (16:49 +0200)
bak-git-server.pl

index 58d4dfe..d3a69d9 100755 (executable)
@@ -20,7 +20,7 @@ controll channel (or to pass through server ssh hops using C<ProxyCommand>)
 
   RemoteForward 9001 192.168.42.42:9001
 
-bak command overview:
+bak command, overview:
 
   bak add /path
   bak commit [/path [message]]
@@ -37,6 +37,8 @@ bak command overview:
 
   bak - push all changed files to server
 
+  bak add,commit /path
+
 See L<http://blog.rot13.org/bak-git> for more information
 
 =cut
@@ -190,6 +192,8 @@ while (my $client = $server->accept()) {
        }
        my $path = $rel_path =~ m{^/} ? $rel_path : "$pwd/$rel_path";
 
+       foreach my $command ( split /,/, $command ) { # XXX command loop
+
        warn "$hostname [$command] $on_host:$path | $message\n";
 
        my $args_message = $message;
@@ -285,6 +289,8 @@ while (my $client = $server->accept()) {
                print $client "ERROR: unknown command: $command\n";
        }
 
+       } # XXX command, loop
+
        close($client);
 }