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

Unified Diff: git_cl.py

Issue 11043031: Allow special java statements (for example imports) to be as long as neccessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fixed existing tests Created 8 years, 2 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 244259df3d5b8876c9e353b4d066dcabdba79ba3..a1889cef4b9cf8fbabb732af3a1dea136aa3aa9b 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -39,6 +39,7 @@ DEFAULT_SERVER = 'https://codereview.appspot.com'
POSTUPSTREAM_HOOK_PATTERN = '.git/hooks/post-cl-%s'
DESCRIPTION_BACKUP_FILE = '~/.git_cl_description_backup'
GIT_INSTRUCTIONS_URL = 'http://code.google.com/p/chromium/wiki/UsingNewGit'
+CHANGE_ID_STR = 'Change-Id:'
# Initialized in main()
@@ -987,6 +988,10 @@ def CMDpresubmit(parser, args):
author=None)
return 0
+def AddChangeIdToCommitMessage(message):
+ git_command = ['commit', '-a', '--amend', '-m %s' % message]
+ RunGit(git_command)
+ print "git-cl: Added Change-Id to commit message."
def GerritUpload(options, args, cl):
"""upload the current branch to gerrit."""
@@ -998,6 +1003,8 @@ def GerritUpload(options, args, cl):
branch = options.target_branch
log_desc = options.message or CreateDescriptionFromLog(args)
+ if not re.search(CHANGE_ID_STR, log_desc):
+ AddChangeIdToCommitMessage(log_desc)
if options.reviewers:
log_desc += '\nR=' + options.reviewers
change_desc = ChangeDescription(log_desc, 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