Staging
v0.5.1
https://github.com/git/git
Revision 181785487ecd48c7a3760ca31a6a245aabb2cbc8 authored by Junio C Hamano on 22 January 2022, 03:05:07 UTC, committed by Junio C Hamano on 22 January 2022, 03:05:07 UTC
1 parent 089b1a8
Raw File
Tip revision: 181785487ecd48c7a3760ca31a6a245aabb2cbc8 authored by Junio C Hamano on 22 January 2022, 03:05:07 UTC
What's cooking (2022/01 #06)
Tip revision: 1817854
candidates
#!/usr/bin/perl
# Feed whats-cooking to this to find what to merge to 'master'

sub merged {
	my ($topic, $base) = @_;
	my $fh;
	(open $fh, "-|", qw(git rev-list), "^$base", $topic)
	    or die "$!";
	my $count = 0;
	while (<$fh>) {
		$count++;
	}
	(close $fh)
	    or die "$! (after $count for $topic)";
	return $count;
}

my ($topic, $topic_date, $last);
my (@candidate);

while (<>) {
	if (/^\* ([a-z][a-z]\/[-a-zA-Z0-9_]+) \(([-0-9]{10})\) \d+ commit/) {
		$topic = $last = $1;
		$topic_date = $2;
		next;
	}
	if (defined $topic) {
		if (/^  \(merged to 'next' on ([-0-9]{10}) at/) {
			push @candidate, [$topic, $1, $topic_date, ""];
			next;
		}
		$topic = undef;
		$topic_date = undef;
	}
	if (defined $last && @candidate && $candidate[-1][0] eq $last) {
		if (/Will merge to 'master'/i) {
			$candidate[-1][3] = "*";
		}
	}
}

for $topic (sort { ($a->[1] cmp $b->[1]) || ($a->[2] cmp $b->[2]) } @candidate) {
	my $count = merged($topic->[0], 'master');
	if ($count) {
		print "$topic->[1] $topic->[2] ($count)	$topic->[3]$topic->[0]\n";
	}
}
back to top