summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-12-06 17:21:09 +0100
committerOswald Buddenhagen <oswald.buddenhagen@gmx.de>2020-02-28 17:03:24 +0000
commit99e6ef291c45f4c71284899a80642103b57e48a5 (patch)
tree46e2d4721f1ea4147d545a4c337d0af8c2b2848f /bin
parent5d5d549cbd31e66bda284823906f2945a87ce74d (diff)
downloadqtrepotools-99e6ef291c45f4c71284899a80642103b57e48a5.tar.gz
gpush: add online list-only mode
unlike the normal (offline) list mode, this queries gerrit and uses that information to annotate the changes. this makes it quite similar to regular push --dry-run mode, except that no actual push is simulated. Change-Id: I1607dd4fc119f0fb2427affa9385158bd0226434 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/git-gpush17
1 files changed, 13 insertions, 4 deletions
diff --git a/bin/git-gpush b/bin/git-gpush
index 8df8594..877381e 100755
--- a/bin/git-gpush
+++ b/bin/git-gpush
@@ -65,6 +65,10 @@ Options:
Report all Changes that would be pushed, then quit.
This is a purely off-line operation.
+ -ll, --list-online
+ Report all Changes that would be pushed, then quit.
+ The Changes are annotated with state information from Gerrit.
+
--aliases
Report all registered aliases and quit.
@@ -129,6 +133,7 @@ my $ref_from;
my $ref_to;
my $force_branch = 0;
my $list_only = 0;
+my $list_online = 0;
my @reviewers;
my @CCs;
@@ -157,6 +162,9 @@ sub parse_arguments(@)
$force_branch = 1;
} elsif ($arg eq "-l" || $arg eq "--list") {
$list_only = 1;
+ } elsif ($arg eq "-ll" || $arg eq "--list-online") {
+ $list_only = 1;
+ $list_online = 1;
} elsif ($arg eq "--aliases") {
foreach my $key (sort(keys %aliases)) {
print "$key = $aliases{$key}\n";
@@ -203,9 +211,9 @@ sub parse_arguments(@)
|| defined($remote) || defined($ref_to);
if ($list_only) {
- fail("--list is incompatible with --quiet/--verbose.\n")
+ fail("--list/--list-online is incompatible with --quiet/--verbose.\n")
if ($quiet || ($verbose && !$debug));
- fail("--list is incompatible with push-modifying options.\n")
+ fail("--list/--list-online is incompatible with push-modifying options.\n")
if ($push_specific);
}
}
@@ -243,7 +251,8 @@ sub caption_group($)
my $to = $$group{branch};
my $tos = defined($to) ? " for $to" : "";
my ($pfx, $rmt) = $list_only
- ? ("Series of", "")
+ ? ("Series of",
+ ($list_online && length($tos)) ? " on '$remote'" : "")
: ("Pushing", " to '$remote'");
return (sprintf("%s %d Change(s)%s%s:",
$pfx, int(@$changes), $tos, $rmt),
@@ -616,7 +625,7 @@ sub update_state($)
sub execute_pushing()
{
- my $online = !$list_only;
+ my $online = !$list_only || $list_online;
my $group = get_changes();
my $pushed_changes = $$group{changes};
if ($online) {