From b58d4bda63e1d8a4966fe2f68e5c466610247fcd Mon Sep 17 00:00:00 2001 From: Sergiy Belozorov Date: Thu, 13 Dec 2018 14:08:49 +0000 Subject: [PATCH] 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 Commit-Queue: Sergiy Belozorov --- git_rebase_update.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/git_rebase_update.py b/git_rebase_update.py index 4545ec96c..e6cc930be 100755 --- a/git_rebase_update.py +++ b/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: