]> de.git.xonotic.org Git - xonotic/div0-gittools.git/blobdiff - git-branch-manager
make reject/unreject/unmerge commit messages nicer
[xonotic/div0-gittools.git] / git-branch-manager
index 447c81a136abd23b1df6513e33e945d276b662eb..78a6d065255dbe03c6f92e1711a1843b8de3f9f4 100755 (executable)
@@ -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}[$_]];
                }