Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: git_cl.py

Issue 259523006: Warn before uploading more than one commit to Gerrit. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index f2f3434e3b8a8557589def595d07e6a8a826fd42..f87566246655dd4d02511adc091f71b69734961f 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1489,6 +1489,14 @@ def GerritUpload(options, args, cl):
return 1
if CHANGE_ID not in change_desc.description:
AddChangeIdToCommitMessage(options, args)
+
+ commits = RunGit(['rev-list', '%s/%s..' % (remote, branch)]).splitlines()
iannucci 2014/04/28 21:02:20 Actually, I think this should be `git_common.get_o
Bernhard Bauer 2014/04/29 08:35:39 The problem is that Gerrit does not know about the
+ if len(commits) > 1:
+ print('WARNING: This will upload %d commits. Run the following command '
+ 'to see which commits will be uploaded: ' % len(commits))
iannucci 2014/04/28 20:59:19 you may also want to advise the potential use of `
Bernhard Bauer 2014/04/29 08:35:39 Done. FYI, I also have a local patch that will sq
+ print('git log %s/%s..' % (remote, branch))
+ ask_for_data('About to upload; enter to confirm.')
+
if options.reviewers:
change_desc.update_reviewers(options.reviewers)
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698