summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-10-17 11:13:55 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-01-12 13:59:52 +0100
commit9f7afd4887915ed4a40338e8138593dbbe738366 (patch)
treea1f70d1f9888df890ac7bc289f1c03cffe3aa6da /bin
parent808993a6027adcf3da8f1c415e82eebd1e6ae283 (diff)
add --remote option and deprecate bareword syntax for remotes
overriding the remote should be an extraordinarily uncommon action with gpush, so there is no need to make it so prominent in the UI. in the next step (in a few months), we can re-use the bare syntax to allow specifying the source commit(s) without appending a colon to them. Change-Id: Iaa814a6be8dc7ce82a1530d0c4eb577a6885079c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/git-gpush10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/git-gpush b/bin/git-gpush
index 5b840a3..191a631 100755
--- a/bin/git-gpush
+++ b/bin/git-gpush
@@ -20,7 +20,7 @@ sub usage
{
print << "EOM";
Usage:
- git gpush [opts] [remote] [[sha1/ref-from]:[ref-to]] [+<reviewer>] [=<CC user>] [-- <push opts>]
+ git gpush [opts] [[sha1/ref-from]:[ref-to]] [+<reviewer>] [=<CC user>] [-- <push opts>]
Pushes changes to Gerrit and adds reviewers and CC to the patch
sets
@@ -57,6 +57,9 @@ Options:
Do not mark the pushed changes as drafts even if they have
WIP markers.
+ -r, --remote
+ Specify the git remote to push to. The default is 'gerrit'.
+
--aliases
Report all registered aliases and quit.
@@ -158,6 +161,9 @@ sub parse_arguments(@)
$draft = 1;
} elsif ($arg eq "-p" || $arg eq "--publish") {
$draft = -1;
+ } elsif ($arg eq "-r" || $arg eq "--remote") {
+ die("--remote needs an argument.\n") if (!@_ || ($_[0] =~ /^-/));
+ $remote = shift @_;
} elsif ($arg eq "--aliases") {
foreach my $key (sort(keys %aliases)) {
print "$key = $aliases{$key}\n";
@@ -181,6 +187,8 @@ sub parse_arguments(@)
$ref_to = $2 if (defined $2 && $2 ne "");
$ref_override = 1;
} else {
+ print STDERR "Warning: Specifying a bare remote is deprecated.".
+ " Use --remote instead.\n";
$remote = $arg;
$remote_override = 1;
}