[git-cl] modify change description before committing.
Otherwise if update_reviewers needs to modify the commit message it won't
show in gerrit.
Bug:
Change-Id: Id81db48b7d15bd17cb924d1d046b31f2c48defa7
Reviewed-on: https://chromium-review.googlesource.com/482062
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
diff --git a/git_cl.py b/git_cl.py
index f0dba6e..bd06467 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2896,12 +2896,16 @@
assert len(change_ids) == 1
change_id = change_ids[0]
+ if options.reviewers or options.tbrs or options.add_owners_to:
+ change_desc.update_reviewers(options.reviewers, options.tbrs,
+ options.add_owners_to, change)
+
remote, upstream_branch = self.FetchUpstreamTuple(self.GetBranch())
parent = self._ComputeParent(remote, upstream_branch, custom_cl_base,
options.force, change_desc)
tree = RunGit(['rev-parse', 'HEAD:']).strip()
ref_to_push = RunGit(['commit-tree', tree, '-p', parent,
- '-m', message]).strip()
+ '-m', change_desc.description]).strip()
else:
change_desc = ChangeDescription(
options.message or CreateDescriptionFromLog(git_diff_args))
@@ -2912,6 +2916,9 @@
DownloadGerritHook(False)
change_desc.set_description(
self._AddChangeIdToCommitMessage(options, git_diff_args))
+ if options.reviewers or options.tbrs or options.add_owners_to:
+ change_desc.update_reviewers(options.reviewers, options.tbrs,
+ options.add_owners_to, change)
ref_to_push = 'HEAD'
# For no-squash mode, we assume the remote called "origin" is the one we
# want. It is not worthwhile to support different workflows for
@@ -2930,10 +2937,6 @@
'single commit.')
confirm_or_exit(action='upload')
- if options.reviewers or options.tbrs or options.add_owners_to:
- change_desc.update_reviewers(options.reviewers, options.tbrs,
- options.add_owners_to, change)
-
# Extra options that can be specified at push time. Doc:
# https://gerrit-review.googlesource.com/Documentation/user-upload.html
refspec_opts = []