Meta: remove obviously stale, unused, and useless bits
Junio C Hamano committed
Jul 18, 2025 at 16:07 UTC
a1ae90fc0dec5156aa89bd47bebe324124b3613c
8 files changed
-839
SR
deleted
-31
@@ -1,31 +0,0 @@
1
-#!/bin/sh
2
-
3
-short=
4
-case "$1" in --short|-s) short=t; shift ;; esac
5
-
6
-parse_version='
7
- s/^\(v[.0-9]*\)\(-\([1-9][0-9]*\)-g\([0-9a-f][0-9a-f]*\)\)*$/v=\1 n=\3 r=\4/
8
-'
9
-
10
-git for-each-ref --format='%(refname)' refs/heads/maint\* |
11
-sed -e 's|^refs/heads/||' -e '/^maint[^-]/d' |
12
-while read track
13
-do
14
- case "$short" in
15
- t)
16
- echo "$track $(git describe "refs/heads/$track")"
17
- ;;
18
- *)
19
- v= n= r=
20
- eval $(git describe "refs/heads/$track" | sed -e "$parse_version")
21
-
22
- echo "* $v..$track"
23
- case "$n" in
24
- "")
25
- ;;
26
- *)
27
- git --no-pager shortlog --no-merges "$v..$track"
28
- ;;
29
- esac
30
- esac
31
-done
TODO
deleted
-35
@@ -1,35 +0,0 @@
1
-The GIT To-Do File
2
-==================
3
-
4
-The latest copy of this document is found at
5
-
6
- http://kernel.org/git/?p=git/git.git;a=blob;hb=todo;f=TODO
7
- http://repo.or.cz/w/alt-git.git?a=blob;hb=todo;f=TODO
8
-
9
-----------------------------------------------------------------
10
-
11
-gmane=http://thread.gmane.org/gmane.comp.version-control.git/
12
-
13
-* Teach pack protocol to transfer estimated pack size and history
14
- depth to allow receiving end make more intelligent decision between
15
- unpack-objects and index-pack.
16
-
17
- $gmane/173610
18
-
19
-* Audit use of symbolic-ref without -m in our scripts and for each
20
- case decide if leaving a reflog entry for the HEAD is desirable.
21
- If so, add them.
22
-
23
- $gmane/172516
24
-
25
-* "git status" on intent-to-add index entries (say "I" in the first
26
- column instead of "A" for short status, add "(needs 'git add')" at the
27
- end of "new file: $path " in long status).
28
-
29
- $gmane/170658
30
-
31
-* synopsys: use {} instead of () for grouping alternatives (Jari Aalto)
32
- $gmane/72243
33
-
34
-* "[alias] st = status" and "cd .git && git st" (Jeff King)
35
- $gmane/72327
UWC
deleted
-248
@@ -1,248 +0,0 @@
1
-#!/usr/bin/perl -w
2
-#
3
-# Update an older edition of What's Cooking with the latest data.
4
-#
5
-# Usage: UWC [--keep-master] [ old [ new ] ]
6
-#
7
-# Giving no parameter is the same as giving a single "-" to the command.
8
-#
9
-# The command reads the old edition of (annotated) "What's Cooking"
10
-# message from "old", and "new". If "old" is "-", it is read from
11
-# the standard input. If "new" is not specified, WC script is run
12
-# and its output is used.
13
-#
14
-# An annotated "What's Cooking" message can have group header (a line
15
-# that has the group name enclosed in "[" and "]"), and annotatation
16
-# paragraphs after each topic's commit list, in addition to the bare
17
-# "WC" output.
18
-#
19
-# The group headers, topics in each group and their order in the group,
20
-# and annotation to topics are preserved from the "old" message. The
21
-# list of commits in each topic is replaced with the one taken from the
22
-# "new" message. Any topic in "new" that did not exist in "old" appear
23
-# in "New Topics" group. Also, topics that do not appear in the "new"
24
-# message are marked with <<deleted>>, topics whose commit list are
25
-# different from "old" are marked with <<updated from...>>>.
26
-#
27
-# Typically the maintainer would place the What's Cooking message
28
-# previously sent in a buffer in Emacs, and filter the buffer contents
29
-# with this script, to prepare an up-to-date message.
30
-
31
-my $keep_master = 1;
32
-
33
-sub parse_whats_cooking {
34
- my ($fh) = @_;
35
- my $head = undef;
36
- my $group = undef;
37
- my %wc = ("group list" => [], "topic hash" => {});
38
- my $topic;
39
- my $skipping_comment = 0;
40
-
41
- while (<$fh>) {
42
- if (/^-{40,}$/) {
43
- # Group separator
44
- next;
45
- }
46
-
47
- if (!defined $head) {
48
- if (/^Here are the topics that have been/) {
49
- $head = $_;
50
- }
51
- next;
52
- }
53
-
54
- if (/^<<.*>>$/) {
55
- next;
56
- }
57
-
58
- if ($skipping_comment) {
59
- if (/^>>$/) {
60
- $skipping_comment = 0;
61
- }
62
- next;
63
- }
64
-
65
- if (!$skipping_comment && /^<</) {
66
- $skipping_comment = 1;
67
- next;
68
- }
69
-
70
- if (/^\[(.*)\]$/) {
71
- $group = $1;
72
- push @{$wc{"group list"}}, $group;
73
- $wc{" $group"} = [];
74
- $topic = undef;
75
- next;
76
- }
77
-
78
- if (!defined $group) {
79
- if (/^\* (\S+) (\(.*\) \d+ commits?)$/) {
80
- # raw output
81
- $group = "Misc";
82
- push @{$wc{"group list"}}, $group;
83
- $wc{" $group"} = [];
84
- } else {
85
- $head .= $_;
86
- next;
87
- }
88
- }
89
-
90
- if (/^\* (\S+) (\(.*\) \d+ commits?)$/) {
91
- $topic = +{
92
- topic => $1,
93
- head => $_,
94
- names => "",
95
- text => "",
96
- };
97
- $wc{"topic hash"}{$topic->{"topic"}} = $topic;
98
- push @{$wc{" $group"}}, $topic;
99
- next;
100
- }
101
-
102
- if (/^ [-+.?*] / || /^ \S/) {
103
- $topic->{"names"} .= $_;
104
- next;
105
- }
106
- $topic->{"text"} .= $_;
107
- }
108
-
109
- for ($head) {
110
- s/\A\s+//s;
111
- s/\s+\Z//s;
112
- }
113
- $wc{"head text"} = $head;
114
- for $topic (values %{$wc{"topic hash"}}) {
115
- for ($topic->{"text"}) {
116
- s/\A\s+//s;
117
- s/\s+\Z//s;
118
- }
119
- }
120
- return \%wc;
121
-}
122
-
123
-sub print_whats_cooking {
124
- my ($wc) = @_;
125
-
126
- print $wc->{"head text"}, "\n";
127
-
128
- for my $group (@{$wc->{"group list"}}) {
129
- print "\n", "-" x 64, "\n";
130
- print "[$group]\n";
131
- for my $topic (@{$wc->{" $group"}}) {
132
- next if ($topic->{"head"} eq '');
133
- print "\n", $topic->{"head"};
134
- print $topic->{"names"};
135
- if ($topic->{"text"} ne '') {
136
- print "\n", $topic->{"text"}, "\n";
137
- }
138
- }
139
- }
140
-}
141
-
142
-sub delete_topic {
143
- my ($wc, $topic) = @_;
144
- $topic->{"status"} = "deleted";
145
-}
146
-
147
-sub merge_whats_cooking {
148
- my ($old_wc, $new_wc) = @_;
149
- my $group;
150
- my @gone = ();
151
-
152
- for $group (@{$old_wc->{"group list"}}) {
153
- for my $topic (@{$old_wc->{" $group"}}) {
154
- my $name = $topic->{"topic"};
155
- my $newtopic = delete $new_wc->{"topic hash"}{$name};
156
-
157
- if (!defined $newtopic) {
158
- push @gone, +{ @{[ %$topic ]} };
159
- $topic->{"text"} = "";
160
- $topic->{"names"} = "";
161
- $topic->{"head"} = "";
162
- next;
163
- }
164
- if (($newtopic->{"names"} ne $topic->{"names"}) ||
165
- ($newtopic->{"head"} ne $topic->{"head"})) {
166
- my $text = ("<<updated from\n" .
167
- $topic->{"head"} .
168
- $topic->{"names"} . ">>");
169
-
170
- if ($topic->{"text"} ne '') {
171
- $text .= "\n\n" . $topic->{"text"};
172
- }
173
- for ($text) {
174
- s/\A\s+//s;
175
- s/\s+\Z//s;
176
- }
177
- $topic->{"text"} = $text;
178
- $topic->{"names"} = $newtopic->{"names"};
179
- $topic->{"head"} = $newtopic->{"head"};
180
- }
181
- }
182
- }
183
-
184
-
185
- $group = 'Graduated to "master"';
186
- if (!$keep_master) {
187
- print STDERR "Not Keeping Master\n";
188
- my $o = delete $old_wc->{" $group"};
189
- for (@$o) {
190
- print STDERR " Dropping: ", $_->{'topic'}, "\n";
191
- }
192
- print STDERR "Gone are\n";
193
- for (@gone) {
194
- print STDERR " Gone: ", $_->{'topic'}, "\n";
195
- }
196
- }
197
- if (@gone) {
198
- if (!exists $old_wc->{" $group"}) {
199
- unshift @{$old_wc->{"group list"}}, $group;
200
- $old_wc->{" $group"} = [];
201
- }
202
- push @{$old_wc->{" $group"}}, @gone;
203
- }
204
- if (%{$new_wc->{"topic hash"}}) {
205
- $group = "New Topics";
206
- if (!exists $old_wc->{" $group"}) {
207
- unshift @{$old_wc->{"group list"}}, $group;
208
- $old_wc->{" $group"} = [];
209
- }
210
- for my $topic (values %{$new_wc->{"topic hash"}}) {
211
- my $name = $topic->{"topic"};
212
- $old_wc->{"topic hash"}{$name} = $topic;
213
- push @{$old_wc->{" $group"}}, $topic;
214
- $topic->{"text"} = $topic->{"text"};
215
- }
216
- }
217
-}
218
-
219
-if (@ARGV == 0) {
220
- @ARGV = ('-');
221
-} elsif ($ARGV[0] eq '--keep-master') {
222
- $keep_master = 1;
223
- shift;
224
-}
225
-if (@ARGV != 2 && @ARGV != 1) {
226
- die "Usage: $0 old [new]\n";
227
-}
228
-
229
-my ($old_wc, $new_wc);
230
-
231
-if ($ARGV[0] eq '-') {
232
- *FH = *STDIN;
233
-} else {
234
- open FH, "$ARGV[0]";
235
-}
236
-$old_wc = parse_whats_cooking(\*FH);
237
-close FH;
238
-
239
-if (@ARGV > 1) {
240
- open FH, "$ARGV[1]";
241
-} else {
242
- open FH, "Meta/WC generate |";
243
-}
244
-$new_wc = parse_whats_cooking(\*FH);
245
-close FH;
246
-
247
-merge_whats_cooking($old_wc, $new_wc);
248
-print_whats_cooking($old_wc);
WC
deleted
-56
@@ -1,56 +0,0 @@
1
-#!/bin/sh
2
-# Prepare "What's cooking in git.git"
3
-
4
-master_at=$(git rev-parse --verify refs/heads/master)
5
-next_at=$(git rev-parse --verify refs/heads/next)
6
-
7
-keep_master=
8
-case "$1" in
9
-generate)
10
- echo Here are the topics that have been
11
- echo
12
- Meta/git-topic.perl --base=master | sed -e 's/^\*./\n*/'
13
- exit
14
- ;;
15
-keep)
16
- keep_master=--keep-master
17
- ;;
18
-esac
19
-
20
-eval $(LC_ALL=C date +"monthname=%b month=%m year=%Y date=%d dow=%a")
21
-
22
-lead="whats/cooking/$year/$month"
23
-issue=$(
24
- cd Meta &&
25
- git ls-tree -r --name-only HEAD "$lead" | tail -n 1
26
-)
27
-if test -n "$issue"
28
-then
29
- issue=$( expr "$issue" : '.*/0*\([1-9][0-9]*\)\.txt$' )
30
- issue=$(( $issue + 1 ))
31
-else
32
- issue=1
33
-fi
34
-issue=$( printf "%02d" $issue )
35
-mkdir -p "Meta/$lead"
36
-
37
-exec >"Meta/$lead/$issue.txt"
38
-
39
-cat <<EOF
40
-To: git@vger.kernel.org
41
-Subject: What's cooking in git.git ($monthname $year, #$issue; $dow, $date)
42
-X-master-at: $master_at
43
-X-next-at: $next_at
44
-
45
-What's cooking in git.git ($monthname $year, #$issue; $dow, $date)
46
---------------------------------------------------
47
-
48
-EOF
49
-
50
-last=$(
51
- cd Meta &&
52
- git ls-tree -r --name-only HEAD "whats/cooking" | tail -n 1
53
-)
54
-
55
-sed -e 's/^\[New Topics\]$/[Old New Topics]/' "Meta/$last" |
56
-Meta/UWC $keep_master
WI
deleted
-76
@@ -1,76 +0,0 @@
1
-#!/bin/sh
2
-# Prepare "What's in git.git"
3
-
4
-maint_at=$(git rev-parse --verify refs/heads/maint)
5
-master_at=$(git rev-parse --verify refs/heads/master)
6
-maint_was=$(git rev-parse --verify refs/hold/sa/maint)
7
-master_was=$(git rev-parse --verify refs/hold/sa/master)
8
-
9
-log () {
10
- git shortlog -w76,2,4 --no-merges "$@"
11
-}
12
-
13
-one () {
14
- git show -s --pretty="format:%h (%s)" "$1"
15
-}
16
-
17
-eval $(LC_ALL=C date +"monthname=%b month=%m year=%Y date=%d dow=%a")
18
-
19
-lead="whats/in/$year/$month"
20
-issue=$(
21
- cd Meta &&
22
- git ls-tree -r --name-only HEAD "$lead" | tail -n 1
23
-)
24
-if test -n "$issue"
25
-then
26
- issue=$( expr "$issue" : '.*/0*\([1-9][0-9]*\)\.txt$' )
27
- issue=$(( $issue + 1 ))
28
-else
29
- issue=1
30
-fi
31
-issue=$( printf "%02d" $issue )
32
-
33
-mkdir -p "Meta/$lead"
34
-exec >"Meta/$lead/$issue.txt"
35
-
36
-cat <<EOF
37
-To: git@vger.kernel.org
38
-Subject: What's in git.git ($monthname $year, #$issue; $dow, $date)
39
-X-maint-at: $maint_at
40
-X-master-at: $master_at
41
-X-maint-was: $maint_was
42
-X-master-was: $master_was
43
-
44
-What's in git.git ($monthname $year, #$issue; $dow, $date)
45
-
46
- maint $(one maint)
47
- master $(one master)
48
-------------------------------------------------------------------------
49
-
50
-BLURB HERE
51
-EOF
52
-
53
-tagged=`git rev-parse --not --verify hold/sa/maint`
54
-list=`git rev-list $tagged refs/heads/maint 2>/dev/null`
55
-a=
56
-if test -n "$list"
57
-then
58
- echo
59
- echo "* The 'maint' branch has these fixes since the last announcement."
60
- echo
61
- log $tagged heads/maint
62
- a='
63
- in addition to the above.'
64
-else
65
- a=.
66
-fi
67
-
68
-tagged=`git rev-parse --not --verify hold/sa/master`
69
-list=`git rev-list $tagged refs/heads/master 2>/dev/null`
70
-if test -n "$list"
71
-then
72
- echo
73
- echo "* The 'master' branch has these since the last announcement$a"
74
- echo
75
- log $tagged heads/master ^heads/maint
76
-fi
count-contributors.sh
deleted
-73
@@ -1,73 +0,0 @@
1
-#!/bin/sh
2
-
3
-LC_ALL=C LANG=C
4
-export LC_ALL LANG
5
-
6
-fmt="%-10s | %7d %7d %7d | %7d %7d | %-10s\n"
7
-hfmt=$(printf "%s" "$fmt" | sed -e 's/d/s/g')
8
-head=$(printf "$hfmt" release new this total this total date)
9
-
10
-old= ocommitcnt=
11
-git for-each-ref --format='%(refname:short)' refs/tags/ |
12
-perl -w -e '
13
- use strict;
14
- my @version = ();
15
- my %asked = map { $_ => $_ } @ARGV;
16
-
17
- while (<STDIN>) {
18
- next unless (/^(v(\d+)\.(\d+)(?:\.(\d+))?(?:-rc(\d+))?)$/);
19
- # $1 = tag == v$2.$3(.$4)?(-rc$5)?
20
-
21
- if (exists $asked{$1}) {
22
- ; # ok
23
- } elsif (defined $5) {
24
- # skip -rc releases
25
- next;
26
- } elsif ($2 == 0) {
27
- # not worth showing breakdown during v0.99 period
28
- next unless ($1 eq "v0.99");
29
- } elsif ($2 == 1) {
30
- # not worth showing breakdown before v1.4.0
31
- next if ($3 < 4 && $4);
32
- }
33
- push @version, [$1, $2, $3, $4, $5];
34
- }
35
- for (sort { (
36
- $a->[1] <=> $b->[1] ||
37
- $a->[2] <=> $b->[2] ||
38
- $a->[3] <=> $b->[3] ||
39
- ( (defined $a->[4] && defined $b->[4])
40
- ? $a->[4] <=> $b->[4]
41
- : defined $a->[4]
42
- ? -1 : 1 ) ); } @version) {
43
- print $_->[0], "\n";
44
- }
45
-' "$@" |
46
-while read new
47
-do
48
- commitcnt=$(git rev-list --no-merges "$new" | wc -l)
49
- git shortlog -s -n "$new" |
50
- sed -e 's/^[ 0-9]*//' |
51
- sort >/var/tmp/new
52
- if test -n "$old"
53
- then
54
- comm -13 /var/tmp/old /var/tmp/new >"/var/tmp/cont-$new"
55
- i=$(git shortlog -s -n "$old..$new" |
56
- sed -e 's/^[ 0-9]*//' |
57
- wc -l)
58
- cc=$(( $commitcnt - $ocommitcnt ))
59
- else
60
- i=$(wc -l </var/tmp/new)
61
- cat /var/tmp/new >"/var/tmp/cont-$new"
62
- cc=$(( $commitcnt + 0 ))
63
- fi
64
- old=$new
65
- mv /var/tmp/new /var/tmp/old
66
- n=$(wc -l <"/var/tmp/cont-$new")
67
- c=$(wc -l <"/var/tmp/old")
68
- t=$(git show -s --format="%ci" "$old^0" | sed -e "s/ .*//")
69
- ocommitcnt=$commitcnt
70
- test -z "$head" || echo "$head"
71
- printf "$fmt" $new $n $i $c $cc $commitcnt $t
72
- head=
73
-done
genMaintNotes.perl
deleted
-102
@@ -1,102 +0,0 @@
1
-#!/usr/bin/perl -w
2
-
3
-print <<'EOF' ;
4
-<a href="http://3.bp.blogspot.com/-zbY2zfS4fKE/TlgfTSTK-oI/AAAAAAAACOQ/E_0Y4408QRE/s1600/GprofileSmall.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://3.bp.blogspot.com/-zbY2zfS4fKE/TlgfTSTK-oI/AAAAAAAACOQ/E_0Y4408QRE/s1600/GprofileSmall.png"></a>
5
-<style>
6
-div.inset {
7
-background: #aff;
8
-color: #888;
9
-margin-left: 10%;
10
-margin-top: 2em;
11
-margin-bottom: 2em;
12
-width: 60%;
13
-padding: 1.2em;
14
-}
15
-div.inset {
16
-color: #444;
17
-}
18
-div.inset a {
19
-color: #444;
20
-}
21
-div.inset a:hover {
22
-color: #00f;
23
-}
24
-h2 {
25
-text-decoration: underline;
26
-color: #888;
27
-}
28
-span.tt {
29
-font-family: monospace;
30
-}
31
-img#ohloh-badge, img#git {
32
-border: none;
33
-float: right;
34
-}
35
-</style>
36
-EOF
37
-
38
-sub show_links {
39
- local ($_) = @_;
40
- my $br = '';
41
- for (split(/\n/, $_)) {
42
- s/^\s*//;
43
- s/\s*\Z//;
44
- my $url = $_;
45
- my $comment = $_;
46
- $url =~ s/ .*//;
47
- if ($url =~ /^http:/) {
48
- print "$br<a href=\"$url\"\n>$comment</a>";
49
- } else {
50
- print "$br$comment";
51
- }
52
- $br = "<br />\n";
53
- }
54
- print "\n";
55
-}
56
-
57
-sub show_commands {
58
- local ($_) = @_;
59
- my $br = '';
60
- for (split(/\n/, $_)) {
61
- s/^\s*//;
62
- s/\s*\Z//;
63
- print "$br<span class=\"tt\">$_</span>";
64
- $br = "<br />\n";
65
- }
66
- print "\n";
67
-}
68
-
69
-my $in_ul;
70
-$/ = "";
71
-while (<>) {
72
- $_ =~ s/\n+$//s;
73
-
74
- if (/^ - /) {
75
- if (!$in_ul) {
76
- $in_ul = 1;
77
- print "<ul>\n";
78
- }
79
- s/^ - //;
80
- print "<li>$_</li>\n";
81
- next;
82
- }
83
-
84
- if ($in_ul) {
85
- $in_ul = undef;
86
- print "</ul>\n\n";
87
- }
88
-
89
- if (s/^\*\s*//) {
90
- print "<h2>$_</h2>\n\n";
91
- } elsif (s/^ {4,}//) {
92
- print "<div class=\"inset\">\n";
93
- if (/^(http|git|nntp):\/\//) {
94
- show_links($_);
95
- } else {
96
- show_commands($_);
97
- }
98
- print "</div>\n\n";
99
- } else {
100
- print "<p>$_</p>\n\n";
101
- }
102
-}
git-topic.perl
deleted
-218
@@ -1,218 +0,0 @@
1
-#!/usr/bin/perl -w
2
-#
3
-# Copyright (c) 2006 Junio C Hamano
4
-#
5
-
6
-use strict;
7
-use Getopt::Long;
8
-
9
-my $topic_pattern = '??*/*';
10
-my $base = 'next';
11
-my @stage = qw(next seen);
12
-my @mark = ('.', '?', '-', '+');
13
-my $all = 0;
14
-my $merges = 0;
15
-my $tests = 0;
16
-
17
-my @custom_stage;
18
-my @custom_mark;
19
-GetOptions("topic=s" => \$topic_pattern,
20
- "base=s" => \$base,
21
- "stage=s" => \@custom_stage,
22
- "mark=s" => \@custom_mark,
23
- "merges!" => \$merges,
24
- "tests!" => \$tests,
25
- "all!" => \$all)
26
- or die;
27
-
28
-if (@custom_stage) { @stage = @custom_stage; }
29
-if (@custom_mark) { @mark = @custom_mark; }
30
-my @nomerges = $merges ? qw(--no-merges) : ();
31
-
32
-sub read_revs_short {
33
- my (@args) = @_;
34
- my @revs;
35
- open(REVS, '-|', qw(git rev-list), @nomerges, @args)
36
- or die;
37
- while (<REVS>) {
38
- chomp;
39
- push @revs, $_;
40
- }
41
- close(REVS);
42
- return @revs;
43
-}
44
-
45
-sub read_revs {
46
- my ($bottom, $top, $mask) = @_;
47
- my @revs;
48
- open(REVS, '-|', qw(git rev-list --pretty=oneline), @nomerges,
49
- "$bottom..$top")
50
- or die;
51
- while (<REVS>) {
52
- chomp;
53
- my ($sha1, $topic) = /^([0-9a-f]{40}) (.*)$/;
54
- push @revs, [$sha1, $topic, $mask];
55
- }
56
- close(REVS);
57
- return @revs;
58
-}
59
-
60
-sub rebase_marker {
61
- my ($topic, $stage, $in_next) = @_;
62
- my @not_in_topic = read_revs_short('^master', "^$topic", "$stage");
63
-
64
- # @$in_next is what is in $stage but not in $base.
65
- # @not_in_topic excludes what came from $topic from @$in_next.
66
- # $topic can be rebased if these two set matches, because
67
- # no commits in $topic has been merged to $stage yet.
68
- if (@not_in_topic != @$in_next) {
69
- # we cannot rebase it anymore
70
- return ' ';
71
- }
72
- if (read_revs_short('master', "^$topic")) {
73
- # there is something that is in master but not in topic.
74
- return '^';
75
- }
76
- # topic is up to date.
77
- return '*';
78
-}
79
-
80
-my %atlog_next = ();
81
-my %atlog_test = ();
82
-
83
-sub next_marker {
84
- my ($topic) = @_;
85
- return '' if (!$tests);
86
- return '??' if (!exists $atlog_next{$topic});
87
- for ($atlog_next{$topic}) {
88
- my ($merge, $test) = ('*', '*');
89
- if (/rerere ok/) {
90
- $merge = 'R';
91
- } elsif (/conflict (\d+)/) {
92
- if ($1 < 10) {
93
- $merge = $1;
94
- } else {
95
- $merge = 'X';
96
- }
97
- }
98
- $test = 'X' if (/test error/);
99
- return "$merge$test";
100
- }
101
-}
102
-
103
-sub test_marker {
104
- my ($commit) = @_;
105
- return '' if (!$tests);
106
- my $tree = `git rev-parse "$commit^{tree}"`;
107
- chomp($tree);
108
- return "?" if (!exists $atlog_test{$tree});
109
- for ($atlog_test{$tree}) {
110
- if (/build error/) {
111
- return 'B';
112
- } elsif (/test error/) {
113
- return 'X';
114
- } else {
115
- return ' ';
116
- }
117
- }
118
-}
119
-
120
-sub describe_topic {
121
- my ($topic) = @_;
122
-
123
- open(CONF, '-|', qw(git repo-config --get),
124
- "branch.$topic.description")
125
- or die;
126
- my $it = join('',<CONF>);
127
- close(CONF);
128
- chomp($it);
129
- if ($it) {
130
- wrap_print(" $it");
131
- }
132
-}
133
-
134
-my @in_next = read_revs_short('^master', $stage[0]);
135
-my @topic = ();
136
-
137
-my @topic_pattern = map { "refs/heads/$_" } (@ARGV ? @ARGV : $topic_pattern);
138
-
139
-open(TOPIC, '-|', qw(git for-each-ref),
140
- '--sort=-authordate',
141
- '--format=%(objectname) %(authordate) %(refname)',
142
- @topic_pattern)
143
- or die;
144
-
145
-while (<TOPIC>) {
146
- chomp;
147
- my ($sha1, $date, $topic) = m|^([0-9a-f]{40})\s(.*?)\srefs/heads/(.+)$|
148
- or next;
149
- push @topic, [$sha1, $date, $topic];
150
-}
151
-close(TOPIC);
152
-
153
-if (open(AT, "Meta/AT.log")) {
154
- my $next = `git rev-parse --verify refs/heads/next`;
155
- chomp $next;
156
- while (<AT>) {
157
- if (/^N (.{40}) (.{40}) (.*)$/ && $1 eq $next) {
158
- $atlog_next{$2} = $3;
159
- next;
160
- }
161
- if (/^A (.{40}) (.*)/) {
162
- $atlog_test{$1} = $2;
163
- next;
164
- }
165
- }
166
- close(AT);
167
-}
168
-
169
-my @last_merge_to_next = ();
170
-
171
-for (@topic) {
172
- my ($sha1, $date, $topic) = @$_;
173
- my @revs = read_revs($base, $sha1, (1<<@stage)-1);
174
- next unless (@revs || $all);
175
-
176
- my %revs = map { $_->[0] => $_ } @revs; # fast index
177
- for (my $i = 0; $i < @stage; $i++) {
178
- for my $item (read_revs_short("^$stage[$i]", $sha1)) {
179
- if (exists $revs{$item}) {
180
- $revs{$item}[2] &= ~(1 << $i);
181
- }
182
- }
183
- }
184
-
185
- print '*' .
186
- next_marker($sha1) .
187
- rebase_marker($sha1, $stage[0], \@in_next);
188
- my $count = "";
189
- if (1 < @revs) {
190
- $count = " " . (scalar @revs) . " commits";
191
- }
192
- elsif (@revs) {
193
- $count = " 1 commit";
194
- }
195
- print " $topic ($date)$count\n";
196
- describe_topic($topic);
197
- for my $item (@revs) {
198
- my $mark = $item->[2];
199
- if ($mark < @mark) {
200
- $mark = $mark[$mark];
201
- }
202
- if ($tests) {
203
- $mark = test_marker($item->[0]) . $mark;
204
- }
205
- wrap_print("$mark $item->[1]");
206
- }
207
-}
208
-
209
-sub wrap_print {
210
- my ($string) = @_;
211
- format STDOUT =
212
-~^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
213
- $string
214
- ~~^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
215
- $string
216
-.
217
- write;
218
-}