chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fa03cb0
)
git-debrebase: abolish recursion
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Wed, 14 Jun 2017 23:14:29 +0000
(
00:14
+0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 16 Jun 2018 11:25:49 +0000
(12:25 +0100)
git-debrebase
patch
|
blob
|
history
diff --git
a/git-debrebase
b/git-debrebase
index 7eefe72a5698703d1256f11056d595676d525444..3578715679cb78b69feabed9841ba4e824ab7036 100755
(executable)
--- a/
git-debrebase
+++ b/
git-debrebase
@@
-314,22
+314,21
@@
sub classify ($) {
return $unknown->("complex merge");
}
return $unknown->("complex merge");
}
-sub walk ($;$$
$$
);
+sub walk ($;$$);
sub walk {
my ($input,
sub walk {
my ($input,
- $nogenerate,$report,
- $wantbrwonly,$depth) = @_;
+ $nogenerate,$report) = @_;
# => ($tip, $breakwater_tip)
# => ($tip, $breakwater_tip)
+ # (or nothing, if $nogenerate)
# go through commits backwards
# we generate two lists of commits to apply:
# breakwater branch and upstream patches
my (@brw_cl, @upp_cl, @processed);
my %found;
# go through commits backwards
# we generate two lists of commits to apply:
# breakwater branch and upstream patches
my (@brw_cl, @upp_cl, @processed);
my %found;
+ my $upp_limit;
my @pseudomerges;
my @pseudomerges;
- $depth //= 0;
-
my $cl;
my $xmsg = sub {
my ($appendinfo) = @_;
my $cl;
my $xmsg = sub {
my ($appendinfo) = @_;
@@
-385,10
+384,9
@@
sub walk {
push @brw_cl, $cl;
$cur = $p0;
next;
push @brw_cl, $cl;
$cur = $p0;
next;
- } elsif ($ty eq 'Packaging') {
- push @brw_cl, $cl;
- $cur = $p0;
- next;
+ } elsif ($ty eq 'BreakwaterStart') {
+ push @brw_cl, { ExactlyParents => [$cur] };
+ last;
} elsif ($ty eq 'Upstream') {
push @upp_cl, $cl;
$cur = $p0;
} elsif ($ty eq 'Upstream') {
push @upp_cl, $cl;
$cur = $p0;
@@
-402,6
+400,7
@@
sub walk {
$queue->(\@brw_cl, "debian");
$queue->(\@upp_cl, "upstream");
$rewrite_from_here->();
$queue->(\@brw_cl, "debian");
$queue->(\@upp_cl, "upstream");
$rewrite_from_here->();
+ $cur = $p0;
next;
} elsif ($ty eq 'Pseudomerge') {
print $report " Contributor=$ty->{Contributor}" if $report;
next;
} elsif ($ty eq 'Pseudomerge') {
print $report " Contributor=$ty->{Contributor}" if $report;
@@
-462,25
+461,21
@@
sub walk {
$xmsg->("convert dgit import: upstream changes")
};
}
$xmsg->("convert dgit import: upstream changes")
};
}
- $prline->("Import");
- $prprdelim->();
- my ($dummy,$basis) = walk
- $ovwr,
- $nogenerate, $report,
- 1, $depth+1;
- push @brw_cl, { ExactlyParents => [$basis] };
+ $prline->(" Import");
$rewrite_from_here->();
$rewrite_from_here->();
- last;
+ $upp_limit //= $#upp; # further, deeper, patches discarded
+ $cur = $ovwr;
+ next;
} else {
# Everything is from this import. This kind of import
# is already in valid breakwater format, with the
# patches as commits.
printf $report " NoPM" if $report;
} else {
# Everything is from this import. This kind of import
# is already in valid breakwater format, with the
# patches as commits.
printf $report " NoPM" if $report;
-
push @brw_cl, { ExactlyParents => [$cur] }
;
+
$prline->(" ImportOrigin")
;
# last thing we processed will have been the first patch,
# if there is one; which is fine, so no need to rewrite
# on account of this import
# last thing we processed will have been the first patch,
# if there is one; which is fine, so no need to rewrite
# on account of this import
-
$prline->("ImportOrigin")
;
+
push @brw_cl, { ExactlyParents => [$cur] }
;
last;
}
die "$ty ?";
last;
}
die "$ty ?";
@@
-489,7
+484,7
@@
sub walk {
}
}
$prprdelim->();
}
}
$prprdelim->();
- return
()
if $nogenerate;
+ return if $nogenerate;
# Now we build it back up again
# Now we build it back up again