diff options
author | Oswald Buddenhagen <oswald.buddenhagen@gmx.de> | 2023-03-11 20:26:58 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@gmx.de> | 2024-01-09 16:37:58 +0000 |
commit | a90c8c9c18c0d95c36f63eeb9e709a03683c604e (patch) | |
tree | f943fea9f6cb4068debbd66057338b50c0b810ad /bin/git-gpush | |
parent | 81832e6f381caa3b2fd7724fad84240859c52d67 (diff) |
gpick: try to deduce remote series base from topic
in lieu of gerrit actually saving the base of a series for us, consider
inconsistent topics to be a marker for a series ending before hitting
upstream, and therefore being based on another pending series.
gpush gets a complementary check that the chained series have different
topics. an alternative would be auto-generated topics, but that wouldn't
be too friendly to reviewers.
as a drive-by, we don't try to aggregate the 'hidden' property on loose
Changes any more - these have no persistent properties, so it was
pointless.
Change-Id: I2c538fe91d9c50fcf87fc6284f621fb3e633b2df
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'bin/git-gpush')
-rwxr-xr-x | bin/git-gpush | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/bin/git-gpush b/bin/git-gpush index c404899..0b91a18 100755 --- a/bin/git-gpush +++ b/bin/git-gpush @@ -1175,8 +1175,11 @@ sub finalize_get_changes($$) my ($changes, $gid) = @_; my %group = (changes => $changes, gid => $gid); - aggregate_bool_property(\%group, "hide", "HIDDEN", "hiding", - "Use --move/--copy/--hide to make it consistent."); + if ($gid) { + aggregate_bool_property(\%group, "hide", "HIDDEN", "hiding", + "Use --move/--copy/--hide to make it consistent."); + $$_{group} = \%group foreach (@$changes); + } return \%group; } @@ -2165,11 +2168,36 @@ sub annotate_changes($) } } +sub annotate_group_base($$) +{ + my ($annot, $group) = @_; + + my $base = $$group{base_chg}; + return if (!$base); # Not during grouping/offline listing + # The group object is available only in --all mode. + my $bgrp = $$base{group}; + my $btpc = ($bgrp ? $$bgrp{topic} : + # This is unreliable, as other Changes in the containing + # series may still contribute a topic. + ($$base{ntopic} // $$base{topic})) // ""; + my $tpc = $$group{topic} // ""; + return if ($tpc ne $btpc); + push @$annot, + "Warning: Both the series and its base Change have " + .(length($tpc) ? "the same" : "no")." topic.\n"; + state $noted; + push @$annot, + "git gpick will be unable to automatically split the series.\n" + if (!$noted++); +} + sub annotate_group($$) { my ($group, $extra) = @_; my @annot; + annotate_group_base(\@annot, $group) + if (!$mail_mode && ($addbase == BASE_NO)); if ($extra) { my $irt = $$group{irt_text}; push @annot, "> In-Reply-To: ".$irt."\n" |