diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-07-21 20:37:06 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-11-23 10:52:41 +0000 |
commit | f3fdd7c966b98d28b3e1f6918e92364ed8c9a7e2 (patch) | |
tree | 4b621b3e858e174a1f652f7e5463a40df8d866f1 | |
parent | 0a579a35ce386d904868bd32d47d6d9eb947a1f2 (diff) |
gpush: remove ability to specify arbitrary git push options
this was once used to pass -n and -v to git, but we do that explicitly
now. passing on unknown options just serves to obfuscate usage errors.
Change-Id: I6d971e7c5ba8d3be7093f4171b4a7a03cf63ec90
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rwxr-xr-x | bin/git-gpush | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/bin/git-gpush b/bin/git-gpush index 1a616c0..5220334 100755 --- a/bin/git-gpush +++ b/bin/git-gpush @@ -23,7 +23,7 @@ sub usage { print << "EOM"; Usage: - git gpush [opts] [[sha1/ref-from]:[ref-to]] [+<reviewer>] [=<CC user>] [-- <push opts>] + git gpush [opts] [[sha1/ref-from]:[ref-to]] [+<reviewer>] [=<CC user>] Pushes Changes to Gerrit and adds reviewers and CC to the PatchSets. @@ -39,12 +39,6 @@ Description: If no ref-to is specified, the upstream branch for 'ref-from' is used as the target branch. - If all the options above have been populated, the remainder - options are passed on directly to the normal 'git push' command. - If you want to avoid specifying all options first, any options - specified after a '--' are also passed on directly to the - underlying 'git push' command. - Note that this program can be used in the middle of an interactive rebase, to push out the amended commits instantly. @@ -119,10 +113,8 @@ my $quiet = 0; my $dry_run = 0; my $remote = "gerrit"; -my $remote_override = 0; my $ref_from = "HEAD"; my $ref_to = ""; -my $ref_override = 0; my $draft = 0; my %aliases; @@ -317,28 +309,21 @@ sub parse_arguments(@) } elsif ($arg eq "-?" || $arg eq "--?" || $arg eq "-h" || $arg eq "--help") { usage(); exit 0; - } elsif ($arg eq "--") { - push @arguments, @_; - return; } elsif ($arg =~ /^\+(.+)/) { push @reviewers, split(/,/, lookup_alias($1)); } elsif ($arg =~ /^\=(.+)/) { push @CCs, split(/,/, lookup_alias($1)); - } elsif ($arg =~ /^\-(.+)/) { - push @arguments, $arg; - } elsif (!$remote_override || !$ref_override) { + } elsif ($arg !~ /^\-/) { if ($arg =~ /(.*):(.*)/) { $ref_from = $1 if (defined $1 && $1 ne ""); $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; } } else { - push @arguments, $arg; + die("Unrecognized option '$arg'.\n"); } } |