]> 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 empty sections to be used in mrconfig files.
authorJoey Hess <joey@gnu.kitenet.net>
Thu, 24 Dec 2009 17:23:27 +0000 (12:23 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Thu, 24 Dec 2009 17:23:27 +0000 (12:23 -0500)
Previously the parser only added a section if it had at least one
configuration line. With this change, an empty section cannot be checked
out by mr, but it can be updated, etc.

debian/changelog
mr

index ca820b580cc11e6535969dac99f123b7995cdcb7..b5d731fb2c6112f1c3c8570cbbc21953879aadad 100644 (file)
@@ -2,6 +2,7 @@ mr (0.47) UNRELEASED; urgency=low
 
   * Pass -L to curl to allow it to follow redirects when bootstrapping.
     (Pavel Avgustinov)
+  * Allow empty sections to be used in mrconfig files.
 
  -- Joey Hess <joeyh@debian.org>  Sun, 13 Dec 2009 13:04:53 -0500
 
diff --git a/mr b/mr
index 0bf66553c08a2dc5556810b1d11359f00e3dd973..7224a04ed2e170626436a89c9056e34c158ab0ff 100755 (executable)
--- a/mr
+++ b/mr
@@ -1037,6 +1037,12 @@ sub loadconfig {
                                }
                        }
                        $section=expandenv($section) if $trusted;
+                       if ($section ne 'ALIAS' &&
+                           ! exists $config{$dir}{$section} &&
+                           exists $config{$dir}{DEFAULT}) {
+                               # copy in defaults
+                               $config{$dir}{$section}={ %{$config{$dir}{DEFAULT}} };
+                       }
                }
                elsif (/^(\w+)\s*=\s*(.*)/) {
                        my $parameter=$1;
@@ -1073,12 +1079,6 @@ sub loadconfig {
                        if (! defined $section) {
                                die "$f line $.: parameter ($parameter) not in section\n";
                        }
-                       if ($section ne 'ALIAS' &&
-                           ! exists $config{$dir}{$section} &&
-                           exists $config{$dir}{DEFAULT}) {
-                               # copy in defaults
-                               $config{$dir}{$section}={ %{$config{$dir}{DEFAULT}} };
-                       }
                        if ($section eq 'ALIAS') {
                                $alias{$parameter}=$value;
                        }