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
$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;
}
"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]]; },