From: Rudolf Polzer Date: Tue, 3 Jan 2012 23:59:43 +0000 (+0100) Subject: git-branch-manager: cleanup features X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=18d96dffe6e3f1bd164a05c51182b2a1b75046f8;p=xonotic%2Fdiv0-gittools.git git-branch-manager: cleanup features --- diff --git a/git-branch-manager b/git-branch-manager index a43225d..42cea14 100755 --- a/git-branch-manager +++ b/git-branch-manager @@ -654,13 +654,24 @@ sub opt_rebase($$) my $commit_id = $1; my $l = rebase_log $r, parse_log(); local $pebkac = 0; - local $do_commit = 0; eval { - reset_to_commit $r; - run_script @{$l->{log}}; - run 'git', 'commit', '--allow-empty', '-m', "::stable-branch::rebase=$r" - or die "git-commit: $!"; + if($cmd eq 'rebase') + { + local $do_commit = 0; + reset_to_commit $r; + run_script @{$l->{log}}; + run 'git', 'commit', '--allow-empty', '-m', "::stable-branch::rebase=$r" + or die "git-commit: $!"; + } + elsif($cmd eq 'resetrebase') + { + run_script ['reset', $r], @{$l->{log}}; + } + elsif($cmd eq 'hardresetrebase') + { + run_script ['hardreset', $r], @{$l->{log}}; + } 1; } or do @@ -768,6 +779,8 @@ Usage: $0 {--reset|-R} revision-hash $0 {--hardreset|-H} revision-hash $0 {--rebase|-b} revision-hash + $0 {--resetrebase|-B} revision-hash + $0 {--hardresetrebase} revision-hash EOF exit 1; } @@ -798,6 +811,8 @@ my $result = GetOptions( "log|l:s", handler \&opt_list, "outstanding|o:s", handler \&opt_list, "rebase|b=s", handler \&opt_rebase, + "resetrebase|B=s", handler \&opt_rebase, + "hardresetrebase=s", handler \&opt_rebase, "skip", handler \$skip, "merge|m=s{,}", handler sub { run_script ['merge', $_[1]]; }, "unmerge|u=s{,}", handler sub { run_script ['unmerge', $_[1]]; },