summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2019-06-20 15:19:23 +0200
committerOswald Buddenhagen <oswald.buddenhagen@gmx.de>2020-02-25 13:09:10 +0000
commit7a7ca3d2ba965ddfa32f1aef812afee6a95f33b9 (patch)
tree26218dcdc0ca80b361075564fbf9946fbe4a3acc /bin
parent4370cfe245a402e41c8c33ddac5014dfa6b226c0 (diff)
downloadqtrepotools-7a7ca3d2ba965ddfa32f1aef812afee6a95f33b9.tar.gz
gpush: remove support for draft changes
the new gerrit version does not have that state any more. support for the replacement (wip and private changes) will be added later. Change-Id: Id5b9a32b9b035a13add69d9adaeb1607319b89ed Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/git-gpush37
1 files changed, 1 insertions, 36 deletions
diff --git a/bin/git-gpush b/bin/git-gpush
index 841a60f..e5d48d4 100755
--- a/bin/git-gpush
+++ b/bin/git-gpush
@@ -40,15 +40,6 @@ Description:
rebase, to push out the amended commits instantly.
Options:
- -d, --draft
- Mark the pushed Changes as drafts. This switch is usually
- unnecessary, as gpush will recognize drafts by "***" in the
- subject. Note that "WIP" is specifically NOT a draft indicator.
-
- -p, --publish
- Do not mark the pushed Changes as drafts even if they have a
- draft indicator.
-
-r, --remote
Specify the git remote to push to.
@@ -117,7 +108,6 @@ my $dry_run = 0;
my $remote = "gerrit";
my $ref_from = "HEAD";
my $ref_to = "";
-my $draft = 0;
my %aliases;
@@ -294,10 +284,6 @@ sub parse_arguments(@)
$verbose = 1;
} elsif ($arg eq "-n" || $arg eq "--dry-run") {
$dry_run = 1;
- } elsif ($arg eq "-d" || $arg eq "--draft") {
- $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 @_;
@@ -338,22 +324,6 @@ sub parse_arguments(@)
die("--quiet and --verbose/--debug are mutually exclusive.\n")
if ($quiet && $verbose);
-
- if ($ref_to =~ s,^refs/for/,,) {
- die "Pushing to refs/for/ is inconsistent with the --draft option.\n" if ($draft > 0);
- print STDERR "Notice: it is unnecessary to specify refs/for/ in the target ref.\n"
- if (!$quiet);
- } elsif ($ref_to =~ s,^refs/drafts/,,) {
- die "Pushing to refs/drafts/ is inconsistent with the --publish option.\n" if ($draft < 0);
- if ($draft) {
- print STDERR "Notice: it is unnecessary to specify refs/drafts/ in the target ref.\n"
- if (!$quiet);
- } else {
- print STDERR "Notice: prefer the --draft option over specifying refs/drafts/ in the target ref.\n"
- if (!$quiet);
- $draft = 1;
- }
- }
}
sub fileContents($)
@@ -512,11 +482,6 @@ sub determine_target()
sub push_patches()
{
- if (!$draft) {
- $_ = read_cmd_line(0, 'git', 'log', '--pretty=%s', '-1', $ref_from);
- $draft = 1 if (/\*{3}|^(.)\1*$/i);
- }
-
print "Pushing $ref_from for $ref_to on $remote ...\n" if (!$quiet);
my @push_options;
@@ -528,7 +493,7 @@ sub push_patches()
push @gitcmd, '-q' if ($quiet);
push @gitcmd, '-n' if ($dry_run);
push @gitcmd, map { ("-o", "$_") } @push_options;
- push @gitcmd, $remote, "$ref_from:refs/".($draft > 0 ? 'drafts' : 'for')."/$ref_to";
+ push @gitcmd, $remote, "$ref_from:refs/for/$ref_to";
run_process(FWD_OUTPUT, @gitcmd);
}