From ce576f99c3d5046ea23380a8e2cdeed106665a1b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 5 Sep 2025 15:43:17 -0700 Subject: [PATCH] Meta/cook: carry section descriptions forward --- cook | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cook b/cook index f717dbba07..93d6351306 100755 --- a/cook +++ b/cook @@ -452,6 +452,7 @@ sub read_previous { my $branch = $blurb; my $last_empty = undef; my (@section, %section, @branch, %branch, %description, @leader); + my (%section_description); my $in_unedited_olde = 0; if (!-r $fn) { @@ -500,6 +501,14 @@ sub read_previous { } next; } + if (defined $section && + !defined $branch && + !/^\* /) { + $section_description{$section} ||= ""; + $section_description{$section} .= "$_\n"; + next; + } + if (defined $section && /^\* (\S+) /) { $branch = $1; $last_empty = 0; @@ -565,6 +574,7 @@ sub read_previous { section_list => \@section, section_data => \%section, topic_description => \%description, + section_description => \%section_description, }; } @@ -583,6 +593,11 @@ sub write_cooking { print $fh '-' x 50, "\n"; print $fh "[$section_name]\n"; my $lead = "\n"; + + if ($cooking->{'section_description'}{$section_name}) { + print $fh "\n", $cooking->{'section_description'}{$section_name}; + } + for my $topic (@{$topic_list}) { my $d = $cooking->{'topic_description'}{$topic}; -- 2.47.3