From 465c66d3377e8fbfae8b7ccbdb28caaa11ae95a7 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Wed, 15 Apr 2015 14:12:59 -0700 Subject: [PATCH] Improve commit message generation for deploy_sdk. Hopefully this will make it slightly more clear that the sky_sdk repository is not actually a stand-alone repository, but rather generated by a script. R=ianh@google.com Review URL: https://codereview.chromium.org/1088223003 --- tools/deploy_sdk.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/deploy_sdk.py b/tools/deploy_sdk.py index c5b481c7d9b..e4bf71adb95 100755 --- a/tools/deploy_sdk.py +++ b/tools/deploy_sdk.py @@ -204,11 +204,18 @@ def main(): if should_commit: # Kinda a hack to make a prettier build dir for the commit: - rel_build_dir = os.path.join(os.path.split(build_dir)[-2:]) + script_path = os.path.relpath(os.path.abspath(__file__), SRC_ROOT) + rel_build_dir = os.path.relpath(build_dir, SRC_ROOT) + revision = git_revision() + commit_url = "https://github.com/domokit/mojo/commit/%s" % revision + pattern = """Autogenerated from %s +Using %s and build output from %s. +""" + commit_message = pattern % (commit_url, script_path, rel_build_dir) subprocess.check_call(['git', 'add', '.'], cwd=sdk_root) subprocess.check_call([ 'git', 'commit', - '-m', '%s from %s' % (rel_build_dir, git_revision()) + '-m', commit_message ], cwd=sdk_root) time_delta = datetime.now() - start_time