Patchwork [kteam-tools] Add --skip command line flag to maint-rebase-branch

login
register
mail settings
Submitter Paolo Pisati
Date March 17, 2011, 3:33 p.m.
Message ID <4D8229DB.5030907@canonical.com>
Download mbox | patch
Permalink /patch/87390/
State New
Headers show

Comments

Paolo Pisati - March 17, 2011, 3:33 p.m.
Add to maint-rebase-branch the ability to git rebase --skip via --skip
command line flag.
Stefan Bader - March 17, 2011, 3:43 p.m.
On 03/17/2011 04:33 PM, Paolo Pisati wrote:
> Add to maint-rebase-branch the ability to git rebase --skip via --skip
> command line flag.
> 
> 
Nice,

looks good to me. Hm, well while you are at it... I think there is a major
drawback with that script that it does not really detect when the rebase command
fails and runs into stuff it should not do.
At least that _Was_ once the case and I never really found time to look into it...

Where you seeing the same still?


-Stefan
Paolo Pisati - March 17, 2011, 4:48 p.m.
On 03/17/2011 04:43 PM, Stefan Bader wrote:
> Nice,
>
> looks good to me. Hm, well while you are at it... I think there is a major
> drawback with that script that it does not really detect when the rebase command
> fails and runs into stuff it should not do.
> At least that _Was_ once the case and I never really found time to look into it...
>
> Where you seeing the same still?

Nope. My problem was that when i was rebasing mvl-dove a couple of
commits that were already in master, were manually applied in mvl-dove
too, so i had a clash and i had to rebase --skip them (--continue
obviously didn't work in these cases), and the script stopped there.
Stefan Bader - March 17, 2011, 4:54 p.m.
On 03/17/2011 05:48 PM, Paolo Pisati wrote:
> On 03/17/2011 04:43 PM, Stefan Bader wrote:
>> Nice,
>>
>> looks good to me. Hm, well while you are at it... I think there is a major
>> drawback with that script that it does not really detect when the rebase command
>> fails and runs into stuff it should not do.
>> At least that _Was_ once the case and I never really found time to look into it...
>>
>> Where you seeing the same still?
> 
> Nope. My problem was that when i was rebasing mvl-dove a couple of
> commits that were already in master, were manually applied in mvl-dove
> too, so i had a clash and i had to rebase --skip them (--continue
> obviously didn't work in these cases), and the script stopped there.
> 

Well if you hit the other case sometime, you know what it is. :) Applied and
pushed your patch.

-Stefan

Patch

From d88e961d329be4b95d8bfac1a337a3f169373ca2 Mon Sep 17 00:00:00 2001
From: Paolo Pisati <paolo.pisati@canonical.com>
Date: Thu, 17 Mar 2011 16:18:22 +0100
Subject: [PATCH] Added --skip command line flag

Added ability to git rebase --skip via --skip command line flag.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 maintscripts/maint-rebase-branch |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/maintscripts/maint-rebase-branch b/maintscripts/maint-rebase-branch
index 13efd0c..d0b26a9 100755
--- a/maintscripts/maint-rebase-branch
+++ b/maintscripts/maint-rebase-branch
@@ -34,6 +34,8 @@  parser.add_option("--continue", action="store_true", default=False,
     dest="continue_rebase", help="continue a disrupted rebase")
 parser.add_option("--debug", action="store_true", default=False,
     dest="debug", help="print loads of verbose messages that might give a clue as to what's going on")
+parser.add_option("--skip", action="store_true", default=False,
+    dest="skip_rebase", help="continue a disrupted rebase skipping next commit")
 
 (opts, args) = parser.parse_args()
 
@@ -142,7 +144,7 @@  if GetPackageInfo(branch)[2] != "UNRELEASED":
 #------------------------------------------------------------------------------
 # Working tree must be clean
 #------------------------------------------------------------------------------
-if opts.continue_rebase == False:
+if opts.continue_rebase == False and opts.skip_rebase == False:
     print "Checking working tree ...",
     if GitListFiles(opts="--others --modified") != []:
         print "NOT CLEAN!"
@@ -169,11 +171,14 @@  if opts.continue_rebase == False:
 # the version number of it. Then rebase the temporary branch on top of the
 # target release.
 #------------------------------------------------------------------------------
-if opts.continue_rebase == False:
+if opts.continue_rebase == False and opts.skip_rebase == False:
     print "Rebasing from", BaseVersion, "to", TargetVersion
     cmd = "git rebase --onto Ubuntu-{0} {1}".format(TargetVersion, MergeBase)
 else:
-    cmd = "git rebase --continue"
+    if opts.continue_rebase == True:
+        cmd = "git rebase --continue"
+    else:
+        cmd = "git rebase --skip"
 p = Popen(cmd, shell=True)
 status = os.waitpid(p.pid, 0)[1]
 if status > 0:
-- 
1.7.1