chiark / gitweb /
Provide access_cfg_bool (no call sites yet)
[dgit.git] / dgit
diff --git a/dgit b/dgit
index bcb6a9c2d040e5adfe3c12f2c8dc8402b2456f6f..ae96531e38072c586035a080e9db3f7fd0c4d399 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -528,6 +528,8 @@ sub git_slurp_config () {
 sub git_get_config ($) {
     my ($c) = @_;
     my $l = $gitcfg{$c};
+    printdebug"C $c ".(defined $l ? messagequote "'$l'" : "undef")."\n"
+       if $debuglevel >= 4;
     $l or return undef;
     @$l==1 or badcfg "multiple values for $c" if @$l > 1;
     return $l->[0];
@@ -692,6 +694,11 @@ sub access_cfg (@) {
     return $value;
 }
 
+sub access_cfg_bool ($$) {
+    my ($def, @keys) = @_;
+    parse_cfg_bool($keys[0], $def, access_cfg(@keys, 'RETURN-UNDEF'));
+}
+
 sub string_to_ssh ($) {
     my ($spec) = @_;
     if ($spec =~ m/\s/) {
@@ -982,7 +989,7 @@ sub sshpsql ($$$) {
     open P, "-|", @cmd or die $!;
     while (<P>) {
        chomp or die;
-       printdebug("$debugprefix>|$_|\n");
+       printdebug(">|$_|\n");
        push @rows, $_;
     }
     $!=0; $?=0; close P or failedcmd @cmd;
@@ -3185,8 +3192,10 @@ sub finalise_opts_opts () {
        }
 
        foreach my $c (access_cfg_cfgs("opts-$k")) {
-           local ($debuglevel) = $debuglevel-2;
            my $vl = $gitcfg{$c};
+           printdebug "CL $c ",
+               ($vl ? join " ", map { shellquote } @$vl : ""),
+               "\n" if $debuglevel >= 4;
            next unless $vl;
            badcfg "cannot configure options for $k"
                if $opts_opt_cmdonly{$k};