Skip to content
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

Follow Semver Rules when git version is run #4086

Closed
1 task done
vbjay opened this issue Oct 30, 2022 · 7 comments
Closed
1 task done

Follow Semver Rules when git version is run #4086

vbjay opened this issue Oct 30, 2022 · 7 comments
Labels

Comments

@vbjay
Copy link

vbjay commented Oct 30, 2022

SemVer Org site

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
    64
$ git --version --build-options

git version 2.38.1.windows.1
cpu: x86_64
built from commit: b85c8f604d375d4d773a36842964e8a7ec056aae
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon

  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver


Microsoft Windows [Version 10.0.19044.2130]

  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VisualStudioCode
Custom Editor Path: 
Default Branch Option:  
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

bash

git version
  • What did you expect to occur after running these commands?
2.38.1+windows.1

example with rc:
2.23.0-rc0+windows.1

There are two problems:

  1. If I am running git version, I know I am asking for git's version. Should not prefix 'git version '
  2. The SemVer rule says build metadata is prefixed with a +. So the windows.# info should be +windows.#
    • 2.23.1+windows.2
    • 2.23.1-rc0+windows.125
    • and so on

See version comparisons for a sample sort of versions.

  • What actually happened instead?

git version 2.38.1.windows.1

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?
@vbjay
Copy link
Author

vbjay commented Oct 30, 2022

string output = @"2.23.0-rc0+windows.1";
output.Dump();
Semver.SemVersion v = Semver.SemVersion.Parse(output, Semver.SemVersionStyles.Any);
v.Dump();
v.ToString().Dump();

image

@rimrul
Copy link
Member

rimrul commented Oct 31, 2022

Git does not follow semver and neither does Git for Windows.

@rimrul rimrul closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2022
@rimrul rimrul added the wontfix label Oct 31, 2022
@vbjay
Copy link
Author

vbjay commented Oct 31, 2022

Git's versioning like below most certainly follows semver

2.38.0-rc2
2.23.0-rc0
2.38.1

image

Please show where git doesn't follow semver?

@rimrul
Copy link
Member

rimrul commented Oct 31, 2022

Yes, Git uses a version number that looks like a semver version number, but they do not adhere to the semver rules on when and how to increment that version number.

@vbjay
Copy link
Author

vbjay commented Oct 31, 2022

I see. Thanks.

@rimrul
Copy link
Member

rimrul commented Oct 31, 2022

  1. The SemVer rule says build metadata is prefixed with a +. So the windows.# info should be +windows.#
    • 2.23.1+windows.2
    • 2.23.1-rc0+windows.125
    • and so on

The semver rules also state

Build metadata MUST be ignored when determining version precedence. Thus two versions that differ only in the build metadata, have the same precedence.

That alone disqualifies the windows.# part from being semver build metadata.
It MUST NOT be ignored when determinng version precedence.

@vbjay
Copy link
Author

vbjay commented Oct 31, 2022

Good point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants