]> 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:

more leaf dir fixes
[code/myrepos.git] / mr
diff --git a/mr b/mr
index b1139e5b2a12f0e908d278fdf18ccac0112e2327..3c998f3e586ea8bc763319543f048ea1aa8af57d 100755 (executable)
--- a/mr
+++ b/mr
@@ -232,6 +232,7 @@ my @repos;
 my $nochdir=0;
 foreach my $topdir (sort keys %config) {
        foreach my $subdir (sort keys %{$config{$topdir}}) {
+               next if $subdir eq 'default';
                my $dir=$topdir.$subdir;
                next if $dir ne $directory && $dir !~ /^\Q$directory\E\//;
                push @repos, [$dir, $topdir, $subdir];
@@ -239,20 +240,20 @@ foreach my $topdir (sort keys %config) {
 }
 if (! @repos) {
        # fallback to find a leaf repo
-       foreach my $topdir (sort keys %config) {
-               foreach my $subdir (sort keys %{$config{$topdir}}) {
+       LEAF: foreach my $topdir (reverse sort keys %config) {
+               foreach my $subdir (reverse sort keys %{$config{$topdir}}) {
+                       next if $subdir eq 'default';
                        my $dir=$topdir.$subdir;
                        my $d=$directory;
                        $dir.="/" unless $dir=~/\/$/;
                        $d.="/" unless $d=~/\/$/;
                        if ($d=~/^\Q$dir\E/) {
                                push @repos, [$dir, $topdir, $subdir];
+                               last LEAF;
                        }
                }
        }
-       if (@repos > 1) {
-               die "mr: found multiple leaf repos (should never happen)";
-       }
+       $nochdir=1;
 }
 
 my (@failed, @successful, @skipped);