summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 711fc8f)
raw | patch | inline | side by side (parent: 711fc8f)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 19 Feb 2006 06:37:02 +0000 (22:37 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 19 Feb 2006 06:37:02 +0000 (22:37 -0800) |
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-fmt-merge-msg.perl | patch | blob | history |
diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index 0467a387e125ab43f051cc31b4b61dca922779aa..616bb521cb2171b8e8e5066a8c022a9317e10d38 100755 (executable)
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
return $val;
}
-sub mergebase {
- my ($other) = @_;
+sub current_branch {
my $fh;
- open $fh, '-|', 'git-merge-base', '--all', 'HEAD', $other or die "$!";
- my (@mb) = map { chomp; $_ } <$fh>;
- close $fh or die "$!";
- return @mb;
+ open $fh, '-|', 'git-symbolic-ref', 'HEAD' or die "$!";
+ my ($bra) = <$fh>;
+ $bra =~ s|^refs/heads/||;
+ if ($bra ne 'master') {
+ $bra = " into $bra";
+ } else {
+ $bra = "";
+ }
+
+ return $bra;
}
sub shortlog {
- my ($tip, $limit, @base) = @_;
+ my ($tip, $limit) = @_;
my ($fh, @result);
open $fh, '-|', ('git-log', "--max-count=$limit", '--topo-order',
- '--pretty=oneline', $tip, map { "^$_" } @base)
+ '--pretty=oneline', $tip, '^HEAD')
or die "$!";
while (<$fh>) {
s/^[0-9a-f]{40}\s+//;
}
push @msg, $this;
}
-print "Merge ", join("; ", @msg), "\n";
+
+my $into = current_branch();
+
+print "Merge ", join("; ", @msg), $into, "\n";
if (!repoconfig) {
exit(0);
for (@origin) {
my ($sha1, $name) = @$_;
- my @mb = mergebase($sha1);
- my @log = shortlog($sha1, $limit + 1, @mb);
+ my @log = shortlog($sha1, $limit + 1);
if ($limit + 1 <= @log) {
print "\n* $name: (" . scalar(@log) . " commits)\n";
}