X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fdiv0-gittools.git;a=blobdiff_plain;f=git-branch-manager;h=78a6d065255dbe03c6f92e1711a1843b8de3f9f4;hp=8c84c128e6c6a1f7aa3bdc75ab9275c8e51b96b1;hb=5e3c3119abce34962eeefcc80c1aeade2eed3008;hpb=e0b0c933dee6c296449485310e968abb0ab08e37 diff --git a/git-branch-manager b/git-branch-manager index 8c84c12..78a6d06 100755 --- a/git-branch-manager +++ b/git-branch-manager @@ -137,7 +137,7 @@ sub reject_commit($) } open my $fh, '>', '.commitmsg' or die ">.commitmsg: $!"; - print $fh "$cmsg" . "::stable-branch::reject=$r\n" + print $fh "REJECT! $cmsg" . "::stable-branch::reject=$r\n" or die ">.commitmsg: $!"; close $fh or die ">.commitmsg: $!"; @@ -183,7 +183,7 @@ sub unreject_commit($) } open my $fh, '>', '.commitmsg' or die ">.commitmsg: $!"; - print $fh "$cmsg" . "::stable-branch::unreject=$r\n" + print $fh "UNREJECT! $cmsg" . "::stable-branch::unreject=$r\n" or die ">.commitmsg: $!"; close $fh or die ">.commitmsg: $!"; @@ -244,9 +244,9 @@ sub merge_commit($) } if($do_commit) { - run 'git', 'commit', '-F', '.commitmsg' + run 'git', 'commit', '--allow-empty', '-F', '.commitmsg' or (run 'git', 'mergetool' - and run 'git', 'commit', '-F', '.commitmsg') + and run 'git', 'commit', '--allow-empty', '-F', '.commitmsg') or die "git-commit: $!"; } } @@ -281,7 +281,7 @@ sub unmerge_commit($) } open my $fh, '>', '.commitmsg' or die ">.commitmsg: $!"; - print $fh "UNMERGE\n$cmsg" . "::stable-branch::unmerge=$r\n" + print $fh "UNMERGE! $cmsg" . "::stable-branch::unmerge=$r\n" or die ">.commitmsg: $!"; close $fh or die ">.commitmsg: $!"; @@ -297,9 +297,9 @@ sub unmerge_commit($) } if($do_commit) { - run 'git', 'commit', '-F', '.commitmsg' + run 'git', 'commit', '--allow-empty', '-F', '.commitmsg' or (run 'git', 'mergetool' - and run 'git', 'commit', '-F', '.commitmsg') + and run 'git', 'commit', '--allow-empty', '-F', '.commitmsg') or die "git-commit: $!"; } } @@ -320,7 +320,7 @@ sub rebase_log($$) { unshift @rlog, ['reject', $log->{order_a}[$_]]; } - elsif(!$log->{bitmap}[$_]) + elsif($log->{bitmap}[$_] == 0) { unshift @rlog, ['unmerge', $log->{order_a}[$_]]; } @@ -795,6 +795,8 @@ my $result = GetOptions( "skip", handler \$skip, "merge|m=s{,}", handler sub { run_script ['merge', $_[1]]; }, "unmerge|u=s{,}", handler sub { run_script ['unmerge', $_[1]]; }, + "reject|r=s{,}", handler sub { run_script ['reject', $_[1]]; }, + "unreject|U=s{,}", handler sub { run_script ['unreject', $_[1]]; }, "reset|R=s", handler sub { run_script ['reset', $_[1]]; }, "hardreset|H=s", handler sub { run_script ['hardreset', $_[1]]; }, "help|h", handler \&opt_help,