]> git.madduck.net Git - code/myrepos.git/commitdiff

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:

allow .mrconfig to be a symlink
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 11 Oct 2007 04:18:21 +0000 (00:18 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 11 Oct 2007 04:18:21 +0000 (00:18 -0400)
abs_path would canonicalise the symlink and mr would try to from the
directory of the file it pointed to, avoid that counterintive behavior

mr

diff --git a/mr b/mr
index aa15728925c0b3ee00cd09acce516e1cda41e2e1..0f80fc8c25165bec270fbbf9103ba8b67f960d60 100755 (executable)
--- a/mr
+++ b/mr
@@ -129,7 +129,7 @@ foreach my $topdir (sort keys %config) {
 
                if (defined $directory &&
                    $dir !~ /^\Q$directory\E\//) {
 
                if (defined $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;
                }
                        push @skipped, $dir;
                        next;
                }
@@ -212,16 +212,17 @@ sub loadconfig {
                $dir="";
        }
        else {
                $dir="";
        }
        else {
-               $f=abs_path($f);
-
-               if ($loaded{$f}) {
+               # $f might be a symlink
+               my $absf=abs_path($f);
+               if ($loaded{$absf}) {
                        return;
                }
                        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=~/^(.*\/)[^\/]+$/;
 
                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;
 
                # copy in defaults from first parent
                my $parent=$dir;