Skip to content

Commit 7f760e8

Browse files
committed
please.sh: retire the finalize function
This logic was used in Azure Pipelines to finalize the release notes before releasing new Git for Windows versions. These days, that job is performed elsewhere, specifically in https://github.com/git-for-windows/git-for-windows-automation/blob/56d8604016d6/update-scripts/tag-git.sh#L55-L62 So let's retire that function (and some support functions, too). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 444f5a8 commit 7f760e8

File tree

1 file changed

+0
-169
lines changed

1 file changed

+0
-169
lines changed

please.sh

Lines changed: 0 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -786,175 +786,6 @@ pkg_copy_artifacts () {
786786
create_bundle_artifact
787787
}
788788

789-
version_from_release_notes () {
790-
sed -e '1s/^# Git for Windows v\(.*\) Release Notes$/\1/' -e 1q \
791-
"$sdk64/usr/src/build-extra/ReleaseNotes.md"
792-
}
793-
794-
today () {
795-
LC_ALL=C date +"%B %-d %Y" |
796-
sed -e 's/\( [2-9]\?[4-90]\| 1[0-9]\) /\1th /' \
797-
-e 's/1 /1st /' -e 's/2 /2nd /' -e 's/3 /3rd /'
798-
}
799-
800-
mention () { # [--may-be-already-there] <what, e.g. bug-fix, new-feature> <release-notes-item>
801-
up_to_date /usr/src/build-extra ||
802-
die "build-extra is not up-to-date\n"
803-
804-
(cd /usr/src/build-extra && node ./add-release-note.js --commit "$@")
805-
}
806-
807-
finalize () { # [--delete-existing-tag] <what, e.g. release-notes>
808-
delete_existing_tag=
809-
release_date=
810-
branch_to_use=
811-
while case "$1" in
812-
--delete-existing-tag) delete_existing_tag=t;;
813-
--release-date=*) release_date="$(echo "${1#*=}" | tr +_ ' ')";;
814-
--use-branch=*) branch_to_use="${1#*=}";;
815-
*) break;;
816-
esac; do shift; done
817-
818-
case "$1" in
819-
rel|rel-notes|release-notes) ;;
820-
*) die "I don't know how to finalize %s\n" "$1";;
821-
esac
822-
823-
up_to_date /usr/src/build-extra ||
824-
die "build-extra is not up-to-date\n"
825-
826-
set_package git &&
827-
git_src_dir="$sdk64$pkgpath"/src/git &&
828-
require_git_src_dir &&
829-
(cd "$git_src_dir"/.git &&
830-
require_remote upstream https://github.com/git/git &&
831-
require_remote git-for-windows \
832-
https://github.com/git-for-windows/git) &&
833-
dir_option="--git-dir=$sdk64$pkgpath"/src/git/.git &&
834-
git "$dir_option" fetch --tags git-for-windows &&
835-
git "$dir_option" fetch --tags upstream ||
836-
die "Could not update Git\n"
837-
838-
case "$branch_to_use" in
839-
*@*)
840-
git "$dir_option" fetch --tags --prune-tags \
841-
"${branch_to_use#*@}" "${branch_to_use%%@*}" ||
842-
die "Could not fetch '%s' from '%s'\n" \
843-
"${branch_to_use%%@*}" "${branch_to_use#*@}"
844-
branch_to_use=FETCH_HEAD
845-
;;
846-
esac
847-
branch_to_use="${branch_to_use:-git-for-windows/main}"
848-
849-
ver="$(git "$dir_option" \
850-
describe --first-parent --match 'v[0-9]*[0-9]' \
851-
"$branch_to_use")" ||
852-
die "Cannot describe current revision of Git\n"
853-
854-
ver=${ver%%-[1-9]*}
855-
856-
# With --delete-existing-tag, delete previously generated tags, e.g.
857-
# from failed automated builds
858-
while test -n "$delete_existing_tag" &&
859-
test 0 = $(git "$dir_option" rev-list --count \
860-
"$ver".."$branch_to_use")
861-
do
862-
case "$ver" in
863-
*.windows.*) ;; # delete and continue
864-
*) break;;
865-
esac
866-
867-
git "$dir_option" tag -d "$ver" ||
868-
die "Could not delete tag '%s'\n" "$ver"
869-
870-
ver="$(git "$dir_option" \
871-
describe --first-parent --match 'v[0-9]*[0-9]' \
872-
"$branch_to_use")" ||
873-
die "Cannot describe current revision of Git\n"
874-
875-
ver=${ver%%-*}
876-
done
877-
878-
case "$ver" in
879-
*.windows.*)
880-
test 0 -lt $(git "$dir_option" rev-list --count \
881-
"$ver".."$branch_to_use") ||
882-
die "Already tagged: %s\n" "$ver"
883-
884-
next_version=${ver%.windows.*}.windows.$((${ver##*.windows.}+1))
885-
display_version="${ver%.windows.*}(${next_version##*.windows.})"
886-
;;
887-
*)
888-
i=1
889-
display_version="$ver"
890-
while git "$dir_option" \
891-
rev-parse --verify $ver.windows.$i >/dev/null 2>&1
892-
do
893-
i=$(($i+1))
894-
display_version="$ver($i)"
895-
done
896-
next_version=$ver.windows.$i
897-
;;
898-
esac
899-
display_version=${display_version#v}
900-
901-
test "$display_version" != "$(version_from_release_notes)" ||
902-
die "Version %s already in the release notes\n" "$display_version"
903-
904-
case "$next_version" in
905-
*.windows.1)
906-
v=${next_version%.windows.1} &&
907-
if ! grep -q "^\\* Comes with \\[Git $v\\]" \
908-
"$sdk64"/usr/src/build-extra/ReleaseNotes.md
909-
then
910-
url=https://github.com/git/git/blob/$v &&
911-
adoc="$(echo "${v#v}" | sed 's/-rc[0-9]*$//').adoc" &&
912-
url=$url/Documentation/RelNotes/$adoc &&
913-
mention feature 'Comes with [Git '$v']('$url').'
914-
fi ||
915-
die "Could not mention that Git was upgraded to $v\n"
916-
;;
917-
esac
918-
919-
test -n "$release_date" ||
920-
release_date="$(today)"
921-
922-
sed -i -e "1s/.*/# Git for Windows v$display_version Release Notes/" \
923-
-e "2s/.*/Latest update: $release_date/" \
924-
"$sdk64"/usr/src/build-extra/ReleaseNotes.md ||
925-
die "Could not edit release notes\n"
926-
927-
(cd "$sdk64"/usr/src/build-extra &&
928-
git commit -s -m "Prepare release notes for v$display_version" \
929-
ReleaseNotes.md) ||
930-
die "Could not commit finalized release notes\n"
931-
932-
(cd "$sdk32"/usr/src/build-extra &&
933-
git pull --ff-only "$sdk64"/usr/src/build-extra main) ||
934-
die "Could not update 32-bit SDK's release notes\n"
935-
}
936-
937-
sign_files () {
938-
if test -z "$(git --git-dir="$sdk64/usr/src/build-extra/.git" \
939-
config alias.signtool)"
940-
then
941-
printf "\n%s\n\n%s\n\n\t%s %s\n\n%s\n\n\t%s\n" \
942-
"WARNING: No signing performed!" \
943-
"To fix this, set alias.signtool to something like" \
944-
"!'c:/PROGRA~1/MICROS~1/Windows/v7.1/Bin/signtool.exe" \
945-
"sign //v //f my-cert.p12 //p my-password'" \
946-
"The Windows Platform SDK contains the signtool.exe:" \
947-
http://go.microsoft.com/fwlink/p/?linkid=84091 >&2
948-
else
949-
for file in "$@"
950-
do
951-
git --git-dir="$sdk64/usr/src/build-extra/.git" \
952-
signtool "$file" ||
953-
die "Could not sign %s\n" "$file"
954-
done
955-
fi
956-
}
957-
958789
bundle_pdbs () { # [--directory=<artifacts-directory] [--unpack=<directory>] [--arch=<arch>] [<package-versions>]
959790
packages="mingw-w64-git-pdb mingw-w64-curl-pdb mingw-w64-openssl-pdb"
960791

0 commit comments

Comments
 (0)