cook: Move temporaries one level down

Junio C Hamano committed Aug 27, 2009 at 18:14 UTC 3d1ab25e00d2f628ad885089767f586e99e2dc28
1 file changed +19 -2
cook.sh
+19 -2
@@ -3,8 +3,10 @@
3 LANG=C LC_ALL=C GIT_PAGER=cat
4 export LANG LC_ALL GIT_PAGER
5
6 -tmp=/var/tmp/cook.$$
7 -trap 'rm -f "$tmp".*' 0
6 +tmpdir=/var/tmp/cook.$$
7 +mkdir "$tmpdir" || exit
8 +tmp="$tmpdir/t"
9 +trap 'rm -fr "$tmpdir"' 0
10
11 git branch --merged "master" | sed -n -e 's/^..//' -e '/\//p' >"$tmp.in.master"
12 git branch --merged "pu" | sed -n -e 's/^..//' -e '/\//p' >"$tmp.in.pu"
@@ -245,8 +247,22 @@ perl -w -e '
247 my $incremental = $ARGV[1] eq "yes";
248 my $last_empty = undef;
249 my (@section, %section, @branch, %branch, %description, @leader);
250 + my $in_unedited_olde = 0;
251
252 while (<STDIN>) {
253 + if ($in_unedited_olde) {
254 + if (/^>>$/) {
255 + $in_unedited_olde = 0;
256 + $_ = " | $_";
257 + }
258 + } elsif (/^<<$/) {
259 + $in_unedited_olde = 1;
260 + }
261 +
262 + if ($in_unedited_olde) {
263 + $_ = " | $_";
264 + }
265 +
266 if (defined $section && /^-{20,}$/) {
267 $_ = "\n";
268 }
@@ -296,6 +312,7 @@ perl -w -e '
312 push @section, $section;
313 $section{$section} = [];
314 }
315 + push @{$section{$section}}, $branch;
316 push @branch, [$branch, $section];
317 $branch{$branch} = (scalar @branch) - 1;
318 if (!exists $description{$branch}) {