3 LANG
=C LC_ALL
=C GIT_PAGER
=cat
4 export LANG LC_ALL GIT_PAGER
7 trap 'rm -f "$tmp".*' 0
9 git branch
--merged "master" |
sed -n -e 's/^..//' -e '/\//p' >"$tmp.in.master"
10 git branch
--merged "pu" |
sed -n -e 's/^..//' -e '/\//p' >"$tmp.in.pu"
12 comm -13 "$tmp.in.master" "$tmp.in.pu"
13 git branch
--no-merged pu |
14 sed -n -e 's/^..//' -e '/\//p'
17 git log
--first-parent --format="%H %ci" master..next |
18 sed -e 's/ [0-2][0-9]:[0-6][0-9]:[0-6][0-9] [-+][0-2][0-9][0-6][0-9]$//' >"$tmp.next"
19 git rev-list master..pu
>"$tmp.commits.in.pu"
23 git rev-list
--no-merges --topo-order "master..$1" --not $2 >"$tmp.list"
24 count
=$
(wc -l <"$tmp.list" |
tr -d ' ')
25 label
="* $1 ($(git show -s --format="%ai
" $1 | sed -e 's/ .*//')) $count commit"
26 test "$count" = 1 || label
="${label}s"
28 count
=$
(git rev-list
"master..$1" |
wc -l)
29 mcount
=$
(git rev-list
"maint..$1" |
wc -l)
30 if test $mcount = $count
43 if test -n "$lastfoundmerge"
45 if test "$lastfoundmerge" = "$merge"
52 mb
=$
(git merge-base
$merge $commit)
53 if test "$mb" = "$commit"
55 merged
=$at merged_with
=$merge
61 lastfoundmerge
=$merged_with
67 elif grep "$commit" "$tmp.commits.in.pu" >/dev
/null
73 if test "$lasttimelabel" != "$thistimelabel"
75 with
=$
(git rev-parse
--short $merged_with)
76 echo " (merged to 'next' on $thistimelabel at $with)"
77 lasttimelabel
=$thistimelabel
79 git show
-s --format=" $commitlabel %s" $commit
86 test -z "$description" || description
="$description;"
97 others
="$others and $other"
103 others
="$others, $other"
107 description
="$description $kind $others"
113 sed -n -e '/^ ..*/p' "$old" >"$tmp.old.nc"
114 sed -n -e '/^ ..*/p' "$new" >"$tmp.new.nc"
115 if cmp "$tmp.old.nc" "$tmp.new.nc" >/dev
/null
128 git rev-list
--no-merges "master..$b"
129 done <"$tmp.branches" |
sort |
uniq -d >"$tmp.shared"
133 b
=$
(git branch
--contains "$shared" |
sed -n -e 's/^..//' -e '/\//p')
135 done <"$tmp.shared" |
sort -u >"$tmp.related"
140 related
=$
(grep " $b " "$tmp.related" |
tr ' ' '\012' |
sort -u |
sed -e '/^$/d')
146 if test -n "$related"
150 test "$b" = "$r" && continue
151 based
=$
(git rev-list
--no-merges $b..
$r |
wc -l |
tr -d ' ')
152 bases
=$
(git rev-list
--no-merges $r..
$b |
wc -l |
tr -d ' ')
153 case "$based,$bases" in
155 same_as
="$same_as$r "
158 based_on
="$based_on$r "
161 used_by
="$used_by$r "
171 format_branch
"$b" "$based_on"
174 test -z "$same_as" || add_desc
'is same as' $same_as
175 test -z "$based_on" || add_desc
'uses' $based_on
176 test -z "$used_by" || add_desc
'is used by' $used_by
177 test -z "$forks" || add_desc
'is related to' $forks
179 test -z "$description" ||
180 echo " (this branch$description.)"
181 } >"$tmp.output.$serial"
183 serial
=$
(( $serial + 1 ))
184 done <"$tmp.branches" >"$tmp.output.toc"
186 eval $
(date +"monthname=%b month=%m year=%Y date=%d dow=%a")
187 lead
="whats/cooking/$year/$month"
190 git ls-tree
-r --name-only HEAD
"$lead" |
tail -n 1
194 issue
=$
( expr "$issue" : '.*/0*\([1-9][0-9]*\)\.txt$' )
195 issue
=$
(( $issue + 1 ))
199 issue
=$
( printf "%02d" $issue )
200 mkdir
-p "Meta/$lead"
204 git ls-tree
-r --name-only HEAD
"whats/cooking" |
tail -n 1
207 # We may have a half-written one already.
209 if test -f "Meta/$lead/$issue.txt"
211 last
="$lead/$issue.txt"
215 master_at
=$
(git rev-parse
--verify refs
/heads
/master
)
216 next_at
=$
(git rev-parse
--verify refs
/heads
/next
)
217 cat >"$tmp.output.blurb" <<EOF
218 To: git@vger.kernel.org
219 Subject: What's cooking in git.git ($monthname $year, #$issue; $dow, $date)
220 X-master-at: $master_at
223 What's cooking in git.git ($monthname $year, #$issue; $dow, $date)
224 --------------------------------------------------
226 Here are the topics that have been cooking. Commits prefixed with '-' are
227 only in 'pu' while commits prefixed with '+' are in 'next'. The ones
228 marked with '.' do not appear in any of the branches, but I am still
233 if test -z "$NO_TEMPLATE" && test -f "Meta/$last"
235 template
="Meta/$last"
242 my $blurb = "b..l..u..r..b";
245 my $incremental = $ARGV[1] eq "yes";
246 my $last_empty = undef;
247 my (@section, %section, @branch, %branch, %description, @leader);
250 if (defined $section && /^-{20,}$/) {
257 if (/^\[(.*)\]\s*$/) {
260 if ($section eq "New Topics" && !$incremental) {
261 $section = "Old New Topics";
263 if (!exists $section{$section}) {
264 push @section, $section;
265 $section{$section} = [];
269 if (defined $section && /^\* (\S+) /) {
272 if (!exists $branch{$branch}) {
273 push @branch, [$branch, $section];
274 $branch{$branch} = (scalar @branch) - 1;
276 push @{$section{$section}}, $branch;
278 if (defined $branch) {
283 if (!exists $description{$branch}) {
284 $description{$branch} = [];
286 push @{$description{$branch}}, $_;
290 open O, ">$tmp.template.blurb";
291 for (@{$description{$blurb}}) {
296 open TOC, ">$tmp.template.toc";
297 for my $section (@section) {
298 for my $branch (@{$section{$section}}) {
299 my $serial = $branch{$branch};
300 print TOC "$branch $serial $section\n";
301 open O, ">$tmp.template.$serial";
302 for (@{$description{$branch}}) {
308 ' <"$template" "$tmp" "$incremental"
311 tail -n 1 "$tmp.template.toc" |
read branch serial section
&& echo $serial
316 if test -z "$TO_STDOUT"
318 exec >"Meta/$lead/$issue.txt"
321 if test -s "$tmp.template.blurb"
323 sed -e '/^---------------*/q' <"$tmp.output.blurb"
324 sed -e '1,/^---------------*/d' <"$tmp.template.blurb"
326 cat "$tmp.output.blurb"
329 while read branch serial
331 grep "^$branch " "$tmp.template.toc" >/dev
/null
&& continue
333 tmpserial
=$
(( $tmpserial + 1 ))
334 echo "$branch $tmpserial New Topics" >>"$tmp.template.toc"
335 cp "$tmp.output.$serial" "$tmp.template.$tmpserial"
336 done <"$tmp.output.toc"
338 current
='--------------------------------------------------
339 [Graduated to "master"]
341 while read branch oldserial section
343 test "$section" = 'Graduated to "master"' &&
344 test "$incremental" = no
&& continue
346 tip
=$
(git rev-parse
--quiet --verify "refs/heads/$branch")
347 mb
=$
(git merge-base master
$tip)
348 test "$mb" = "$tip" ||
continue
349 if test -n "$current"
356 cat "$tmp.template.$oldserial"
357 done <"$tmp.template.toc"
360 while read branch oldserial section
362 found
=$
(grep "^$branch " "$tmp.output.toc") ||
continue
363 newserial
=$
(expr "$found" : '[^ ]* \(.*\)')
364 if test "$current" != "$section"
367 echo "--------------------------------------------------
374 show_topic
"$tmp.template.$oldserial" "$tmp.output.$newserial"
375 done <"$tmp.template.toc"