Index: git_cl.py |
diff --git a/git_cl.py b/git_cl.py |
index e8cadf270d1d9a7f85aed299e41f2bb328499b66..f99d0913bb1cd8cc6cde201adfa85e3b39a40e89 100755 |
--- a/git_cl.py |
+++ b/git_cl.py |
@@ -1494,6 +1494,16 @@ 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() |
+ if len(commits) > 1: |
+ print('WARNING: This will upload %d commits. Run the following command ' |
+ 'to see which commits will be uploaded: ' % len(commits)) |
+ print('git log %s/%s...' % (remote, branch)) |
+ print('You can also use `git squash-branch` to squash these into a single' |
+ 'commit.') |
+ ask_for_data('About to upload; enter to confirm.') |
+ |
if options.reviewers: |
change_desc.update_reviewers(options.reviewers) |