From 844cf2963be2f1e178382cfaf2906a7215746368 Mon Sep 17 00:00:00 2001 From: Aaron Gable Date: Wed, 28 Jun 2017 11:32:59 -0700 Subject: [PATCH] git-cl: only set WIP on first upload It seems like some folks are confused by additional patchsets after the first putting the change back into WIP mode. This confusion is honestly understandable. Maybe we try only setting it on the very first upload, and just controlling the notify parameter for future patchsets. Bug: 721836, 737675 Change-Id: If56e5c71e0c6b3b46c2e30ac0b6d80b878218181 Reviewed-on: https://chromium-review.googlesource.com/552779 Reviewed-by: Quinten Yearsley Reviewed-by: Dirk Pranke Reviewed-by: smut Commit-Queue: Aaron Gable --- git_cl.py | 9 ++++++++- tests/git_cl_test.py | 8 ++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/git_cl.py b/git_cl.py index 5b945b90e..5d0375c01 100755 --- a/git_cl.py +++ b/git_cl.py @@ -3016,10 +3016,17 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): # https://gerrit-review.googlesource.com/Documentation/user-upload.html refspec_opts = [] + # By default, new changes are started in WIP mode, and subsequent patchsets + # don't send email. At any time, passing --send-mail will mark the change + # ready and send email for that particular patch. if options.send_mail: refspec_opts.append('ready') + refspec_opts.append('notify=ALL') else: - refspec_opts.append('wip') + if not self.GetIssue(): + refspec_opts.append('wip') + else: + refspec_opts.append('notify=NONE') # TODO(tandrii): options.message should be posted as a comment # if --send-email is set on non-initial upload as Rietveld used to do it. diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index b1c5f7c6f..65eedb104 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -1519,9 +1519,13 @@ class TestGitCl(TestCase): '1hashPerLine\n'), ] - ref_suffix = '%wip' if notify: - ref_suffix = '%ready' + ref_suffix = '%ready,notify=ALL' + else: + if not issue: + ref_suffix = '%wip' + else: + ref_suffix = '%notify=NONE' if title: ref_suffix += ',m=' + title