kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: MINOR: Merge script improvements
Date Fri, 13 Oct 2017 11:25:28 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 9806c1b17 -> a51e3bf5e


MINOR: Merge script improvements

- Remove "list commits" since we never use it
- Fix release branch detection to just look
for branches that start with digits
- Make script executable

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #4067 from ijuma/merge-script-improvements


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/a51e3bf5
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/a51e3bf5
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/a51e3bf5

Branch: refs/heads/trunk
Commit: a51e3bf5e61e37177bd61d385332f97021a8face
Parents: 9806c1b
Author: Ismael Juma <ismael@juma.me.uk>
Authored: Fri Oct 13 12:24:54 2017 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Fri Oct 13 12:24:54 2017 +0100

----------------------------------------------------------------------
 kafka-merge-pr.py | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/a51e3bf5/kafka-merge-pr.py
----------------------------------------------------------------------
diff --git a/kafka-merge-pr.py b/kafka-merge-pr.py
index 0c18b5d..db1427e 100755
--- a/kafka-merge-pr.py
+++ b/kafka-merge-pr.py
@@ -67,8 +67,6 @@ JIRA_BASE = "https://issues.apache.org/jira/browse"
 JIRA_API_BASE = "https://issues.apache.org/jira"
 # Prefix added to temporary branches
 TEMP_BRANCH_PREFIX = "PR_TOOL"
-# TODO Introduce a convention as this is too brittle
-RELEASE_BRANCH_PREFIX = "0."
 
 DEV_BRANCH_NAME = "trunk"
 
@@ -154,17 +152,7 @@ def merge_pr(pr_num, target_ref, title, body, pr_repo_desc):
     reviewers = raw_input(
         "Enter reviewers in the format of \"name1 <email1>, name2 <email2>\":
").strip()
 
-    commits = run_cmd(['git', 'log', 'HEAD..%s' % pr_branch_name,
-                      '--pretty=format:%h [%an] %s']).split("\n")
-    
-    if len(commits) > 1:
-        result = raw_input("List pull request commits in squashed commit message? (y/n):
")
-        if result.lower() == "y":
-          should_list_commits = True
-        else:
-          should_list_commits = False
-    else:
-        should_list_commits = False
+    run_cmd(['git', 'log', 'HEAD..%s' % pr_branch_name, '--pretty=format:%h [%an] %s']).split("\n")
 
     merge_message_flags = []
 
@@ -190,13 +178,8 @@ def merge_pr(pr_num, target_ref, title, body, pr_repo_desc):
 
     # The string "Closes #%s" string is required for GitHub to correctly close the PR
     close_line = "Closes #%s from %s" % (pr_num, pr_repo_desc)
-    if should_list_commits:
-        close_line += " and squashes the following commits:"
     merge_message_flags += ["-m", close_line]
 
-    if should_list_commits:
-        merge_message_flags += ["-m", "\n".join(commits)]
-
     run_cmd(['git', 'commit', '--author="%s"' % primary_author] + merge_message_flags)
 
     continue_maybe("Merge complete (local ref %s). Push to %s?" % (
@@ -394,7 +377,7 @@ def main():
     original_head = get_current_branch()
 
     branches = get_json("%s/branches" % GITHUB_API_BASE)
-    branch_names = filter(lambda x: x.startswith(RELEASE_BRANCH_PREFIX), [x['name'] for x
in branches])
+    branch_names = filter(lambda x: x[0].isdigit(), [x['name'] for x in branches])
     # Assumes branch names can be sorted lexicographically
     latest_branch = sorted(branch_names, reverse=True)[0]
 


Mime
View raw message