enable diff against local files not in bak
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 14 Oct 2010 09:09:58 +0000 (11:09 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 14 Oct 2010 09:09:58 +0000 (11:09 +0200)
This allows you to quickly see if local file (which is not yet tracked
by bak) has changes compared to any remote file.

Have in mind that this will create copy of both files on server, so you
can inspect them later and/or add them to bak if any modifications
are made. This is useful to track intent "I wonder if this file is
changed" directly in bak :-)

bak-git-server.pl

index 5b91ddc..6c8a8f9 100755 (executable)
@@ -160,6 +160,7 @@ while (my $client = $server->accept()) {
                $command = 'log --patch-with-stat' if $command =~ m/^ch/;
                pull_changes( $hostname ) if $command eq 'diff';
                if ( $on_host ) {
+                       system 'rsync', '-avv', "root\@$hostname:$path", "$hostname/$path";
                        system 'rsync', '-avv', "root\@$on_host:$path", "$on_host/$path";
                        open(my $diff, '-|', "diff -Nuw $hostname$path $on_host$path");
                        while(<$diff>) {