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

git command update-git-for-windows does not work when rc releases are installed #1843

Closed
t-b opened this issue Sep 18, 2018 · 14 comments · Fixed by git-for-windows/build-extra#392
Labels
Milestone

Comments

@t-b
Copy link

t-b commented Sep 18, 2018

I recently installed rc2 of git for windows 2.19. After the final release of 2.19 I was not prompted with an update message (auto updates are enabled). Manually updating did not work, as git update-git-for-windows did not return anything.

On manual installation of 2.19 the installer asked me if I want to downgrade.

@dscho
Copy link
Member

dscho commented Sep 28, 2018

Correct. This is a long-standing bug, and I continue to fail time to work on this.

If you have time to spare, I would really welcome your help.

@dscho dscho added the bug label Sep 28, 2018
@t-b
Copy link
Author

t-b commented Sep 28, 2018

@dscho Thanks for verifying it. I'll see what I can do. Note to future self: Here is the place to dive into -> https://github.com/git-for-windows/build-extra/blob/54a4e3f9d0b43267fd9156551b70e7df82eb383b/git-extra/git-update-git-for-windows#L11.

@dscho
Copy link
Member

dscho commented Sep 28, 2018

@t-b not only there: the downgrade warning you mentioned is due to InnoSetup failing to detect from looking at the version number in the registry that it was an -rc version. I think we need to make our InnoSetup script smarter so that it stores an extra flag "isPrerelease" or some such, together with the version number before that. Maybe in the PreviousData? That information would then need to be picked up by the "is this a downgrade?" check.

@dscho
Copy link
Member

dscho commented Jan 1, 2020

I addressed this in the meantime.

@dscho dscho closed this as completed Jan 1, 2020
@t-b
Copy link
Author

t-b commented May 24, 2021

This is unfortunately not fixed.

Here I get

$ git update
Warning! `git update` has been deprecated;
Please use `git update-git-for-windows` instead.
Git for Windows 2.32.0.rc0.windows.1 (64bit)
Update 2.31.1.windows.1 is available
Download and install Git for Windows 2.31.1 [N/y]?

@derrickstolee
Copy link

This is unfortunately not fixed.

Here I get

$ git update
Warning! `git update` has been deprecated;
Please use `git update-git-for-windows` instead.
Git for Windows 2.32.0.rc0.windows.1 (64bit)
Update 2.31.1.windows.1 is available
Download and install Git for Windows 2.31.1 [N/y]?

I think this is behaving as intended: the release candidate is a "pre release" but the latest full "release" is v2.31.1.windows.1. The updater is only comparing for exact string equality in the versions, so is not detecting that v2.32.0-rc0 is "newer" than v2.31.1.

Now, there might be room for an extension of the feature to perform a (signed) version comparison that will say if the latest release is greater than your current release.

@rimrul
Copy link
Member

rimrul commented May 25, 2021

This was fixed, but the original fix incorrectly assumed RC numbering to start at 1. git-for-windows/build-extra#347 extends that fix to cover rc0 as well. It'll be included in future rc0 pre-releases.

@PhilipOakley
Copy link

Just to say I've also experiencing the same issue that the updater isn't suggesting moving forward from the rc* installed version 😃

phili@Philip-Win10 MINGW64 ~
$ git version
git version 2.32.0.rc2.windows.1

phili@Philip-Win10 MINGW64 ~
$ git up
Git for Windows 2.32.0.rc2.windows.1 (64-bit)

phili@Philip-Win10 MINGW64 ~
$ git update
Warning! `git update` has been deprecated;
Please use `git update-git-for-windows` instead.
Git for Windows 2.32.0.rc2.windows.1 (64-bit)

phili@Philip-Win10 MINGW64 ~
$ git update-git-for-windows
Git for Windows 2.32.0.rc2.windows.1 (64-bit)

I'll update/ manually install. https://github.com/git-for-windows/git/releases/

@PhilipOakley
Copy link

Note, my git up is an alias for the longer git update-git-for-windows...

PhilipOakley referenced this issue in git-for-windows/build-extra Jun 24, 2021
Use signed version comparisons before recommending upgrade
@t-b
Copy link
Author

t-b commented Nov 16, 2021

Upgrading from rc fails to work here as well.

Today I did:

$ git update-git-for-windows
Git for Windows 2.34.0.rc2.windows.1 (64-bit)
$ git --version
git version 2.34.0.rc2.windows.1

and I had to manually install the new version.

If preferred I can also open a new bug. I can't reopen this here.

@dscho
Copy link
Member

dscho commented Nov 16, 2021

Today I did:

$ git update-git-for-windows
Git for Windows 2.34.0.rc2.windows.1 (64-bit)
$ git --version
git version 2.34.0.rc2.windows.1

and I had to manually install the new version.

You did not run the git-update-git-for-windows script with -x, did you?

@PhilipOakley
Copy link

PhilipOakley commented Nov 16, 2021 via email

@PhilipOakley
Copy link

PhilipOakley commented Nov 16, 2021 via email

@t-b
Copy link
Author

t-b commented Nov 16, 2021

Nope I did not, cause I did not know.

Here is the output:

$ sh -x git-update-git-for-windows
+ test --test-version-compare '!=' ''
+ update_git_for_windows
++ git config --get http.proxy
+ proxy=
+ test -n ''
+ yn=
+ use_gui=
+ quiet=
+ testing=
+ test 0 -gt 0
+ case "$(uname -m)" in
++ uname -m
+ bit=64
+ try_toast=
+ test -z ''
+ test -f git-update-git-for-windows.config
+ fork=
+ test -n ''
+ git_label='Git for Windows'
+ releases_url=https://api.github.com/repos/git-for-windows/git/releases
+ latest_tag_url=https://gitforwindows.org/latest-tag.txt
+ latest_eval='latest=${latest_tag#v}'
++ http_get https://gitforwindows.org/latest-tag.txt
++ url=https://gitforwindows.org/latest-tag.txt
+++ mktemp -t gfw-httpget-XXXXXXXX.txt
++ output=/tmp/gfw-httpget-BztmNuwb.txt
+++ curl --silent --show-error --output /tmp/gfw-httpget-BztmNuwb.txt --write-out '%{http_code}' https://gitforwindows.org/latest-tag.txt
++ code=200
++ fdout=1
++ ret=0
++ test 200 -ge 400
++ cat /tmp/gfw-httpget-BztmNuwb.txt
++ rm -f /tmp/gfw-httpget-BztmNuwb.txt
++ return 0
+ latest_tag=v2.34.0.windows.1
+ eval 'latest=${latest_tag#v}'
++ latest=2.34.0.windows.1
+ latest=2.34.0.windows.1
+ test -z ''
++ get_recently_seen
++ '[' -f /c/Users/thomas/.git-for-windows-updater ']'
++ git config -f /c/Users/thomas/.git-for-windows-updater winUpdater.recentlySeenVersion
+ recently_seen=2.31.1.windows.1
+ test -n ''
++ git --version
++ sed 's/git version //'
+ version=2.34.0.rc2.windows.1
+ test -d /arm64/bin
+ arch_bit=64-bit
+ echo 'Git for Windows 2.34.0.rc2.windows.1 (64-bit)'
Git for Windows 2.34.0.rc2.windows.1 (64-bit)
+ test -z ''
+ test 2.34.0.windows.1 = 2.34.0.rc2.windows.1
+ test -n ''
++ version_compare 2.34.0.rc2.windows.1 2.34.0.windows.1
++ a=2.34.0.rc2.windows.1
++ b=2.34.0.windows.1
++ true
++ test -n 2.34.0.windows.1
++ test -n 2.34.0.rc2.windows.1
+++ expr 2.34.0.rc2.windows.1 : '^\([0-9]*\)'
++ a1=2
++ a=.34.0.rc2.windows.1
+++ expr 2.34.0.windows.1 : '^\([0-9]*\)'
++ b1=2
++ b=.34.0.windows.1
++ test -z 2
++ test -n 2
++ test 2 -le 2
++ test 2 -le 2
+++ expr .34.0.rc2.windows.1 : '^\([^0-9]\+\)'
++ a1=.
++ a=34.0.rc2.windows.1
+++ expr .34.0.windows.1 : '^\([^0-9]\+\)'
++ b1=.
++ b=34.0.windows.1
++ case "$a1,$b1" in
++ true
++ test -n 34.0.windows.1
++ test -n 34.0.rc2.windows.1
+++ expr 34.0.rc2.windows.1 : '^\([0-9]*\)'
++ a1=34
++ a=.0.rc2.windows.1
+++ expr 34.0.windows.1 : '^\([0-9]*\)'
++ b1=34
++ b=.0.windows.1
++ test -z 34
++ test -n 34
++ test 34 -le 34
++ test 34 -le 34
+++ expr .0.rc2.windows.1 : '^\([^0-9]\+\)'
++ a1=.
++ a=0.rc2.windows.1
+++ expr .0.windows.1 : '^\([^0-9]\+\)'
++ b1=.
++ b=0.windows.1
++ case "$a1,$b1" in
++ true
++ test -n 0.windows.1
++ test -n 0.rc2.windows.1
+++ expr 0.rc2.windows.1 : '^\([0-9]*\)'
++ a1=0
++ a=.rc2.windows.1
+++ expr 0.windows.1 : '^\([0-9]*\)'
++ b1=0
++ b=.windows.1
++ test -z 0
++ test -n 0
++ test 0 -le 0
++ test 0 -le 0
+++ expr .rc2.windows.1 : '^\([^0-9]\+\)'
++ a1=.rc
++ a=2.windows.1
+++ expr .windows.1 : '^\([^0-9]\+\)'
++ b1=.windows.
++ b=1
++ case "$a1,$b1" in
++ true
++ test -n 1
++ test -n 2.windows.1
+++ expr 2.windows.1 : '^\([0-9]*\)'
++ a1=2
++ a=.windows.1
+++ expr 1 : '^\([0-9]*\)'
++ b1=1
++ b=
++ test -z 1
++ test -n 2
++ test 2 -le 1
++ echo 1
++ return
+ test 0 -lt 1
+ return

For that I reinstalled:

git version 2.34.0.rc2.windows.1

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

Successfully merging a pull request may close this issue.

5 participants