You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2018/02/12 15:38:36 UTC

mesos git commit: Started from merge-base when posting reviews.

Repository: mesos
Updated Branches:
  refs/heads/master 8ef59ed50 -> a52ff5baf


Started from merge-base when posting reviews.

When posting a review originally created from a branch B, it could
happen that the resulting review included garbage changes if B was
updated between revisions. (i.e., pulling new master changes)

This review changes the logic of the post-reviews.py script to only
include the changes between HEAD and the merge base of the tracking
branch into the review.

Review: https://reviews.apache.org/r/65545/


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

Branch: refs/heads/master
Commit: a52ff5baf1a755f29e8fa90ace02576856551742
Parents: 8ef59ed
Author: Benno Evers <be...@mesosphere.com>
Authored: Mon Feb 12 15:11:44 2018 +0100
Committer: Benjamin Bannier <bb...@apache.org>
Committed: Mon Feb 12 16:37:24 2018 +0100

----------------------------------------------------------------------
 support/post-reviews.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a52ff5ba/support/post-reviews.py
----------------------------------------------------------------------
diff --git a/support/post-reviews.py b/support/post-reviews.py
index 94b4325..a6646f2 100755
--- a/support/post-reviews.py
+++ b/support/post-reviews.py
@@ -199,6 +199,19 @@ def main():
     # Always put us back on the original branch.
     atexit.register(lambda: execute(['git', 'checkout', branch]))
 
+    # Warn if the tracking branch is no direct ancestor of this review chain.
+    if execute([
+            'git', 'merge-base', '--is-ancestor', tracking_branch, branch_ref],
+            ignore_errors=True) is None:
+        print >> sys.stderr, \
+            "WARNING: Tracking branch '%s' is no direct ancestor of HEAD." \
+            " Did you forget to rebase?" % tracking_branch
+
+        try:
+            raw_input("Press enter to continue or 'Ctrl-C' to abort.\n")
+        except KeyboardInterrupt:
+            sys.exit(0)
+
     merge_base = execute(
         ['git', 'merge-base', tracking_branch, branch_ref]).strip()
 
@@ -209,6 +222,7 @@ def main():
         '--pretty=format:%Cred%H%Creset -%C'
         '(yellow)%d%Creset %s %Cgreen(%cr)%Creset',
         merge_base + '..HEAD'])
+
     print 'Running \'%s\' across all of ...' % " ".join(post_review)
     print output
 
@@ -230,7 +244,7 @@ def main():
         sha = line.split()[0]
         shas.append(sha)
 
-    previous = tracking_branch
+    previous = merge_base
     parent_review_request_id = None
     for i, sha in enumerate(shas):
         execute(['git', 'branch', '-D', temporary_branch], True)