Skip to content

prepare-embargoed-branches: special-case some older release trains #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions prepare-embargoed-branches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ then
version="${version%(*}.${version##*(}"
version=${version%)}
;;
*[^0-9.]*|*..*|.*|*.) die "Invalid version: '$version'";;
*[!0-9.]*|*..*|.*|*.) die "Invalid version: '$version'";;
*.*.*.*)
# major.minor.patch.extra
v0="${version#*.*.*.}"
previous_version_prefix=${version%.$v0}
previous_version=${version%.$v0}
previous_version_prefix=$previous_version
;;
*.*.*) previous_version_prefix=${version%.*}.$((${version##*.}-1));; # major.minor.patch
*.*.*)
previous_version=${version%.*}.$((${version##*.}-1))
previous_version_prefix=$previous_version
;; # major.minor.patch
*) die "Invalid version: '$version'";;
esac
branch_name=git-$version
Expand All @@ -47,6 +51,18 @@ else
test -n "$previous_version_prefix" || die "Invalid version: '$version'"
branch_name=mingit-$previous_version_prefix.x-releases
fi
case "$previous_version" in
2.46.3)
# There was no Git for Windows v2.46.3, so we use v2.46.2
previous_version=2.46.2
previous_version_prefix=2.46.2
;;
2.47.2)
# There was no Git for Windows v2.47.3, so we use v2.47.1(2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/2.47.3/2.47.2/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, no... This switch case is about the previous version, that is, the script is called with v2.47.3 and previous_version will then be set to 2.47.2...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the switch seems to be correct, but the comment claims that 2.47.3 didn't exist, whereas the code special cases 2.47.2 not existing.

previous_version=2.47.1.2
previous_version_prefix=2.47.1
;;
esac
grep_version_regex="$(echo "$previous_version_prefix" | sed 's/\./\\\\&/g')"

handle_repo () {
Expand Down