chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
git fetching: git_lrfetch_sane: Introduce my $url
[dgit.git]
/
dgit
diff --git
a/dgit
b/dgit
index 667919c4b38a9705581916ce48b49a00ff26f5e8..4f6d111b18c25fbe67356fad08c85d900c5bc483 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-659,7
+659,9
@@
sub git_get_config ($) {
my ($c) = @_;
foreach my $src (@gitcfgsources) {
my $l = $gitcfgs{$src}{$c};
my ($c) = @_;
foreach my $src (@gitcfgsources) {
my $l = $gitcfgs{$src}{$c};
- printdebug"C $c ".(defined $l ? messagequote "'$l'" : "undef")."\n"
+ printdebug"C $c ".(defined $l ?
+ join " ", map { messagequote "'$_'" } @$l :
+ "undef")."\n"
if $debuglevel >= 4;
$l or next;
@$l==1 or badcfg "multiple values for $c".
if $debuglevel >= 4;
$l or next;
@$l==1 or badcfg "multiple values for $c".
@@
-675,7
+677,10
@@
sub cfg {
my $v = git_get_config($c);
return $v if defined $v;
my $dv = $defcfg{$c};
my $v = git_get_config($c);
return $v if defined $v;
my $dv = $defcfg{$c};
- return $dv if defined $dv;
+ if (defined $dv) {
+ printdebug "CD $c $dv\n" if $debuglevel >= 4;
+ return $dv;
+ }
}
badcfg "need value for one of: @_\n".
"$us: distro or suite appears not to be (properly) supported";
}
badcfg "need value for one of: @_\n".
"$us: distro or suite appears not to be (properly) supported";
@@
-2485,7
+2490,7
@@
sub ensure_we_have_orig () {
#---------- git fetch ----------
#---------- git fetch ----------
-sub lrfetchrefs () { return "refs/dgit-fetch/
$csuite"
; }
+sub lrfetchrefs () { return "refs/dgit-fetch/
".access_basedistro()
; }
sub lrfetchref () { return lrfetchrefs.'/'.server_branch($csuite); }
# We fetch some parts of lrfetchrefs/*. Ideally we delete these
sub lrfetchref () { return lrfetchrefs.'/'.server_branch($csuite); }
# We fetch some parts of lrfetchrefs/*. Ideally we delete these
@@
-2534,7
+2539,9
@@
sub git_lrfetch_sane {
# git fetch to try to generate it. If we don't manage to generate
# the target state, we try again.
# git fetch to try to generate it. If we don't manage to generate
# the target state, we try again.
- printdebug "git_fetch_us specs @specs\n";
+ my $url = access_giturl();
+
+ printdebug "git_lrfetch_sane specs @specs\n";
my $specre = join '|', map {
my $x = $_;
my $specre = join '|', map {
my $x = $_;
@@
-2542,7
+2549,7
@@
sub git_lrfetch_sane {
$x =~ s/\\\*$/.*/;
"(?:refs/$x)";
} @specs;
$x =~ s/\\\*$/.*/;
"(?:refs/$x)";
} @specs;
- printdebug "git_
fetch_us
specre=$specre\n";
+ printdebug "git_
lrfetch_sane
specre=$specre\n";
my $wanted_rref = sub {
local ($_) = @_;
return m/^(?:$specre)$/o;
my $wanted_rref = sub {
local ($_) = @_;
return m/^(?:$specre)$/o;
@@
-2551,13
+2558,13
@@
sub git_lrfetch_sane {
my $fetch_iteration = 0;
FETCH_ITERATION:
for (;;) {
my $fetch_iteration = 0;
FETCH_ITERATION:
for (;;) {
- printdebug "git_
fetch_us
iteration $fetch_iteration\n";
+ printdebug "git_
lrfetch_sane
iteration $fetch_iteration\n";
if (++$fetch_iteration > 10) {
fail "too many iterations trying to get sane fetch!";
}
my @look = map { "refs/$_" } @specs;
if (++$fetch_iteration > 10) {
fail "too many iterations trying to get sane fetch!";
}
my @look = map { "refs/$_" } @specs;
- my @lcmd = (@git, qw(ls-remote -q --refs),
access_giturl()
, @look);
+ my @lcmd = (@git, qw(ls-remote -q --refs),
$url
, @look);
debugcmd "|",@lcmd;
my %wantr;
debugcmd "|",@lcmd;
my %wantr;
@@
-2583,11
+2590,10
@@
END
"+refs/$_:".lrfetchrefs."/$_";
} @specs;
"+refs/$_:".lrfetchrefs."/$_";
} @specs;
- printdebug "git_
fetch_us
fspecs @fspecs\n";
+ printdebug "git_
lrfetch_sane
fspecs @fspecs\n";
- my @fcmd = (@git, qw(fetch -p -n -q), access_giturl(), @fspecs);
- runcmd_ordryrun_local @git, qw(fetch -p -n -q), access_giturl(),
- @fspecs;
+ my @fcmd = (@git, qw(fetch -p -n -q), $url, @fspecs);
+ runcmd_ordryrun_local @fcmd if @fspecs;
%lrfetchrefs_f = ();
my %objgot;
%lrfetchrefs_f = ();
my %objgot;
@@
-2639,7
+2645,7
@@
END
}
last;
}
}
last;
}
- printdebug "git_
fetch_us
: git fetch --no-insane emulation complete\n",
+ printdebug "git_
lrfetch_sane
: git fetch --no-insane emulation complete\n",
Dumper(\%lrfetchrefs_f);
}
Dumper(\%lrfetchrefs_f);
}