diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-07-07 00:15:46 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-07-07 00:21:09 +0100 |
commit | 87da76cc34151e4623797b32d16c351029969bb6 (patch) | |
tree | 5b78edc4b0065189e131db711b276e5be5535888 /git-debrebase | |
parent | 27aec8c7cfd2cfd315e321d9ac335872665bcfc0 (diff) |
git-debrebase: status: Reorganise commit reporting.
Replace the references to @_ with a hash. Using a hash is much less
confusing than all this numerical indexing. Also, \@_ is wrong
because there is only one @_, so by the time it is dereference, the
commit being printed is the anchor.
This is why in #903131 we see
branch is unlaundered
found mixed upstream/packaging commit (7badba627162337c7057002f37e9a1a593d07d08)
abcc6260 Update to upstream 2.9.7
which appears to sugggest that the anchor is a mixed commit. Actually
the mixed commit is 7badba627162 but the subsequent message is based
on @_ which has different information in it by then.
And, set $kcmsg from the main message, not including the commit
information. We are the more sophisticated caller mentioned in the
previous commmit.
Closes: #903131.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'git-debrebase')
-rwxr-xr-x | git-debrebase | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/git-debrebase b/git-debrebase index 292471d..557e789 100755 --- a/git-debrebase +++ b/git-debrebase @@ -1389,15 +1389,20 @@ sub cmd_status () { # todo: gdr status should print upstream component(s) info # todo: gdr should leave/maintain some refs with this kind of info ? - my $oldest = [ 0 ]; + my $oldest = { Badness => 0 }; my $newest; my $note = sub { - my ($badness, $ourmsg, $snagname, $kcmsg, $cl) = @_; - if ($oldest->[0] < $badness) { + my ($badness, $ourmsg, $snagname, $dummy, $cl, $kcmsg) = @_; + if ($oldest->{Badness} < $badness) { $oldest = $newest = undef; } - $oldest = \@_; # we're walking backwards - $newest //= \@_; + $oldest = { + Badness => $badness, + CommitId => $cl->{CommitId}, + OurMsg => $ourmsg, + KcMsg => $kcmsg, + }; + $newest //= $oldest; }; my ($anchor, $bw) = keycommits +(git_rev_parse 'HEAD'), sub { $note->(1, 'branch contains furniture (not laundered)', @_); }, @@ -1414,16 +1419,16 @@ sub cmd_status () { }; print "current branch contents, in git-debrebase terms:\n"; - if (!$oldest->[0]) { + if (!$oldest->{Badness}) { print " branch is laundered\n"; } else { - print " $oldest->[1]\n"; + print " $oldest->{OurMsg}\n"; my $printed = ''; foreach my $info ($oldest, $newest) { - my $cid = $info->[4]{CommitId}; + my $cid = $info->{CommitId}; next if $cid eq $printed; $printed = $cid; - print " $info->[3]\n"; + print " $info->{KcMsg}\n"; $prcommitinfo->($cid); } } |