Skip to content

Commit f0310fd

Browse files
committed
please.sh mention: rip out obsolete logic and hand off to add-release-note
When generating the release notes of v2.40.0-rc0, I noticed in git-for-windows/git#4316 (comment) that a section was added unnecessarily. The reason is that a crucial function was removed in git-for-windows#457. The plan was to retire the entire release process based on `please.sh` and Azure Pipelines, and redo everything in git-for-windows-automation via a `tag-git` workflow, but that workflow simply is not ready yet. In preparation for those improved workflows, I already reimplemented the `sed` logic of `please.sh mention [...]` with a more straight-forward node.js script. Let's just use that script in `please.sh mention` before phasing out the functionality from `please.sh`. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent d5fe921 commit f0310fd

File tree

1 file changed

+1
-70
lines changed

1 file changed

+1
-70
lines changed

please.sh

Lines changed: 1 addition & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,79 +2574,10 @@ today () {
25742574
}
25752575

25762576
mention () { # [--may-be-already-there] <what, e.g. bug-fix, new-feature> <release-notes-item>
2577-
may_be_already_there=
2578-
test --may-be-already-there != "$1" || {
2579-
may_be_already_there=t
2580-
shift
2581-
}
2582-
case "$1" in
2583-
bug|bugfix|bug-fix) what="Bug Fixes";;
2584-
new|feature|new-feature) what="New Features";;
2585-
*) die "Don't know how to mention %s\n" "$1";;
2586-
esac
2587-
shift
2588-
2589-
quoted="* $(echo "$*" | sed "s/[\\\/\"'&]/\\\\&/g")"
2590-
25912577
up_to_date /usr/src/build-extra ||
25922578
die "build-extra is not up-to-date\n"
25932579

2594-
release_notes="$sdk64"/usr/src/build-extra/ReleaseNotes.md
2595-
latest="$(version_from_release_notes)"
2596-
if test "$latest" != "$(previous_version_from_release_notes)"
2597-
then
2598-
# insert whole "Changes since" section
2599-
date="$(sed -n -e '2s/Latest update: //p' -e 2q \
2600-
<"$release_notes")"
2601-
quoted="v$latest ($date)\\n\\n### $what\\n\\n$quoted"
2602-
quoted="## Changes since Git for Windows $quoted"
2603-
sed -i -e "/^## Changes since/{s/^/$quoted\n\n/;:1;n;b1}" \
2604-
"$release_notes"
2605-
else
2606-
search=$(echo "$quoted" | sed -r -e 's#.*Comes with \[(.* v|patch level).*#\1#' -e 's#[][]#\\&#g')
2607-
sed -i -e '/^## Changes since/{
2608-
:1;n;
2609-
/^### '"$what"'/b3;
2610-
/^### Bug Fixes/b2;
2611-
/^## Changes since/b2;
2612-
b1;
2613-
2614-
:2;s/^/### '"$what"'\n\n'"$quoted"'\n\n/;b7;
2615-
2616-
:3;/^\*/b4;n;b3;
2617-
2618-
:4;/'"$search"'/b5;n;b6;:5;N;s/^.*\n//;:6;/^\*/b4;
2619-
2620-
s/^/'"$quoted"'\n/;
2621-
2622-
:7;n;b7}' "$release_notes"
2623-
fi ||
2624-
die "Could not edit release notes\n"
2625-
2626-
# make sure that the Git version is always reported first
2627-
case "$*" in
2628-
'Comes with [Git v'*)
2629-
sed -i -ne '/^### New Features/{
2630-
p;n;
2631-
/^$/{p;n};
2632-
:1;
2633-
/^\* Comes with \[Git v/{G;:2;p;n;b2};
2634-
x;/./{G;x};n;b1;
2635-
}' -e p "$release_notes"
2636-
;;
2637-
esac
2638-
2639-
test -z "$may_be_already_there" ||
2640-
! git -C "$sdk64"/usr/src/build-extra --no-pager \
2641-
diff --exit-code --quiet HEAD ||
2642-
return 0 # already added; nothing to be done anymore
2643-
2644-
(cd "$sdk64"/usr/src/build-extra &&
2645-
what_singular="$(echo "$what" |
2646-
sed -e 's/Fixes/Fix/' -e 's/Features/Feature/')" &&
2647-
git commit -s -m "Mention $what_singular in release notes" \
2648-
-m "$(echo "$*" | fmt -72)" ReleaseNotes.md) ||
2649-
die "Could not commit release note edits\n"
2580+
node ./add-release-note.js --commit "$@"
26502581
}
26512582

26522583
finalize () { # [--delete-existing-tag] <what, e.g. release-notes>

0 commit comments

Comments
 (0)