]> git.madduck.net Git - code/myrepos.git/blobdiff - mr

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

fix mr update when inside a repo
[code/myrepos.git] / mr
diff --git a/mr b/mr
index aa15728925c0b3ee00cd09acce516e1cda41e2e1..c15b3a393725f28ec55a84613a87daefcea2f668 100755 (executable)
--- a/mr
+++ b/mr
@@ -128,8 +128,9 @@ foreach my $topdir (sort keys %config) {
                my $dir=$topdir.$subdir;
 
                if (defined $directory &&
+                   $dir ne $directory &&
                    $dir !~ /^\Q$directory\E\//) {
-                       print "mr $action: $dir skipped per -d parameter\n" if $verbose;
+                       print "mr $action: $dir skipped per -d parameter ($directory)\n" if $verbose;
                        push @skipped, $dir;
                        next;
                }
@@ -193,7 +194,7 @@ sub showstat {
        return;
 }
 print "\nmr $action: finished (".join("; ",
-       showstat($#successes+1, "success", "sucesses"),
+       showstat($#successes+1, "success", "successes"),
        showstat($#failures+1, "failure", "failures"),
        showstat($#skipped+1, "skipped", "skipped"),
 ).")\n";
@@ -212,16 +213,17 @@ sub loadconfig {
                $dir="";
        }
        else {
-               $f=abs_path($f);
-
-               if ($loaded{$f}) {
+               # $f might be a symlink
+               my $absf=abs_path($f);
+               if ($loaded{$absf}) {
                        return;
                }
-               $loaded{$f}=1;
+               $loaded{$absf}=1;
 
                print "mr: loading config $f\n" if $verbose;
                open($in, "<", $f) || die "mr: open $f: $!\n";
                ($dir)=$f=~/^(.*\/)[^\/]+$/;
+               $dir=abs_path($dir)."/";
 
                # copy in defaults from first parent
                my $parent=$dir;