浏览代码

Add a feature to specify branches to be re-based

Change-Id: I00f1d6716ca5ece647d7ac15471ded25c1f164b2
Reviewed-on: https://chromium-review.googlesource.com/c/1370125
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Sergiy Belozorov 6 年之前
父节点
当前提交
b58d4bda63
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      git_rebase_update.py

+ 6 - 0
git_rebase_update.py

@@ -223,6 +223,9 @@ def main(args=None):
   parser.add_argument('--no_fetch', '--no-fetch', '-n',
                       action='store_true',
                       help='Skip fetching remotes.')
+  parser.add_argument('branches', nargs='*',
+                      help='Branches to be rebased. All branches are assumed '
+                           'if none specified.')
   opts = parser.parse_args(args)
 
   if opts.verbose:  # pragma: no cover
@@ -273,6 +276,9 @@ def main(args=None):
   # Rebase each branch starting with the root-most branches and working
   # towards the leaves.
   for branch, parent in git.topo_iter(branch_tree):
+    # Only rebase specified branches, unless none specified.
+    if opts.branches and branch not in opts.branches:
+      continue
     if git.is_dormant(branch):
       print 'Skipping dormant branch', branch
     else: