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

Unified Diff: git_number.py

Issue 222103006: git-number cannot commit-tree without user config (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_number.py
diff --git a/git_number.py b/git_number.py
index 6c11cee23433332d2ddd748570efa6d2bec8badc..e1c69f159f7c2bc2603fdee76e57f604b47f21e7 100755
--- a/git_number.py
+++ b/git_number.py
@@ -134,6 +134,12 @@ def finalize(targets):
idx = os.path.join(git.run('rev-parse', '--git-dir'), 'number.idx')
env = os.environ.copy()
env['GIT_INDEX_FILE'] = idx
+ # Git user.name and/or user.email may not be configured, so specifying them
agable 2014/04/02 23:29:47 Nonono. These environment variables, if present, o
+ # explicitly. They are not used, but requried by Git.
+ env['GIT_AUTHOR_NAME'] = 'git-number'
+ env['GIT_AUTHOR_EMAIL'] = 'chrome-infrastructure-team@google.com'
+ env['GIT_COMMITTER_NAME'] = env['GIT_AUTHOR_NAME']
+ env['GIT_COMMITTER_EMAIL'] = env['GIT_AUTHOR_EMAIL']
progress_message = 'Finalizing: (%%(count)d/%d)' % len(DIRTY_TREES)
with git.ProgressPrinter(progress_message) as inc:
@@ -157,7 +163,7 @@ def finalize(targets):
for t in targets:
commit_cmd.extend(['-p', binascii.hexlify(t)])
commit_cmd.append(tree_id)
- commit_hash = git.run(*commit_cmd)
+ commit_hash = git.run(*commit_cmd, env=env)
git.run('update-ref', REF, commit_hash)
DIRTY_TREES.clear()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698