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

Windows Download Button Text Discrepancy #1206

Closed
1 task done
noelleleigh opened this issue May 5, 2018 · 2 comments · Fixed by #1207
Closed
1 task done

Windows Download Button Text Discrepancy #1206

noelleleigh opened this issue May 5, 2018 · 2 comments · Fixed by #1207

Comments

@noelleleigh
Copy link

noelleleigh commented May 5, 2018

Please make sure you are NOT reporting a problem about git itself

  • This is not an issue about
    • the Git documentation (a.k.a. man/help pages, i.e. anything with a URL starting with https://git-scm.com/docs), which should be raised with the community,
    • the contents of the Pro Git book (i.e. anything with a URL starting with https://git-scm.com/book or its PDF versions), which should be raised at progit/progit2.
    • Git itself, which should also be raised with the community, or
    • Git for Windows, which should be raised at git-for-windows/git.
    • and is actually about the website itself (e.g. website-specific content, JS, or CSS that doesn't seem to be doing its job correctly).

Currently, the button shown for downloading the latest Windows release is showing the filename rather than the version has it has previously:

Previous (from archive.org) Current Expected
web archive org_web_20180105024757_https___git-scm com_ git-scm com_ git-scm com_ 1

The DOM element where this information is stored shows a discrepancy between the format of the macOS version (semver) and the Windows version (filename):

<span data-mac="2.16.3" data-win="Git-2.17.0-32-bit.exe" id="installer-version"></span>

Here is the Javascript that updates the button text based on that element:

} else if (os == "Windows") {
$(".monitor").addClass("windows");
$("#download-link").text("Download " + $("#installer-version").attr('data-win') + " for Windows").attr("href", "/download/win");
$("#gui-link").removeClass('mac').addClass('gui');
$("#gui-link").text("Windows GUIs").attr("href", "/download/gui/win");
$("#alt-link").removeClass("windows").addClass("mac");
$("#alt-link").text("Mac Build").attr("href", "/download/mac");
$("#gui-os-filter").attr('data-os', 'windows');
$("#gui-os-filter").text("Only show GUIs for my OS (Windows)")

I believe the issue lies in this section of the downloads_controller, but I don't have a development version of this site to test changes:
def latest_mac_installer
@mac_installer ||= Download.latest_for 'mac'
@mac_installer ? @mac_installer.version.name : ''
end
def latest_win_installer
@win_installer ||= Download.latest_for 'windows32'
@win_installer ? @win_installer.version.name : ''
end

@pedrorijo91
Copy link
Member

thanks a lot for the detailed report @noahleigh !

would you like to submit a PR with the fix? :)

@pedrorijo91
Copy link
Member

pedrorijo91 commented May 6, 2018

I had a quick look on this. It seems the name of the git for windows released are extracted from the assets on the repository releases. For instance: https://github.com/git-for-windows/git/releases/tag/v2.17.0.windows.1

I think this issue was introduced a while ago when migrating the rake task logic into a rails service: 0f4974e#diff-2426dabc6613c25dd009ffe7b4a91788

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

Successfully merging a pull request may close this issue.

2 participants