-
Notifications
You must be signed in to change notification settings - Fork 461
Improved Git version parsing to support release candidates #1854
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5b3b0ca to
808b77b
Compare
dscho
approved these changes
Aug 7, 2025
Member
dscho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Member
Author
Add support for parsing Git versions that include a release candidate 'tag' such as 2.51.0-rc0, which will have VFS version strings like: "2.51.0-rc0.vfs.0.0". Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Drop unused (except by tests) methods for parsing the Git installer file name to extract a version number. The installer file name in the tests was out-of-date anyway (no longer contains "gvfs"). Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
808b77b to
e30e98f
Compare
dscho
approved these changes
Aug 13, 2025
Member
dscho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
derrickstolee
approved these changes
Aug 13, 2025
Merged
mjcheetham
added a commit
to microsoft/git
that referenced
this pull request
Sep 3, 2025
The existing build-git-installers.yml workflow did not handle building
release candidate builds correctly, mainly because it hasn't been
exercised with a real release candidate build.
During the rc-stages of v2.51.0, various issues were uncovered:
- The tag validation was looking for the wrong format. Release candidate
tags look like `v2.X.Y-rcN.vfs.W.Z`, but it was checking for a tag like
`v2.X.Y.vfs.W.Z.rcN`.
- The GIT-VERSION-GEN script does some munging of the tag to get to the
_build_ version. Specifically the `-rc` part is replaced with `.rc` and
the leading `v` is dropped.. so a tag of `v2.51.0-rc0.vfs.0.0` will
become `2.51.0.rc0.vfs.0.0`. The macOS installed Makefile and scripts to
create the Debian package did not correctly account for this, leading to
build strings that were not consistent with those for Windows builds.
With these changes, we can now successfully build release candidate
versions. Tags must be of the form:
```text
v2.X.Y-rcN.vfs.W.Z
```
The resulting build version (output from `git --version`) looks like:
```text
2.X.Y.rcN.vfs.W.Z
```
Installer and package file names maintain the _tag_ version format, for
example:
- Git-2.51.0-rc0.vfs.0.0-{64-bit,arm64}.exe
- PortableGit-2.51.0-rc0.vfs.0.0-{64-bit,arm64}.7z.exe
- git-2.51.0-rc0.vfs.0.0-universal.{pkg,dmg}
- microsoft-git_2.51.0-rc0.vfs.0.0.deb
See an example successful build here:
https://github.com/microsoft/git/actions/runs/16830521090
VFS for Git recently learned to correctly parse these release candidate
version strings here: microsoft/VFSForGit#1854
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for parsing Git versions that include a release candidate 'tag' such as 2.51.0-rc0, which will have a
git versionoutput like: "2.51.0.rc0". For Microsoft Git releases the tags looks like 2.51.0-rc0.vfs.0.0 andgit versionoutput like "2.51.0.rc0.vfs.0.0".Also drop unused (except by tests) methods for parsing the Git installer file name to extract a version number. The installer file name in the tests was out-of-date anyway (no longer contains "gvfs").