From a216bb545b990dfc4727a245cbca441cb80fd7f8 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 30 Apr 2025 10:36:04 +0200 Subject: [PATCH 1/4] update-download-data: accommodate for recent changes in Git for Windows As of v2.49.0, Git for Windows no longer ships 32-bit (also known as "i686" or "Intel 32-bit") installers. However, Git for Windows started shipping ARM64 versions since v2.47.1. Let's accommodate for that by recording these artifacts, using the CPU architecture rather than merely the bitness (which would now be meaningless because both x64 and arm64 are 64-bit). Subsequent commits will consume these new data items. Signed-off-by: Johannes Schindelin --- script/update-download-data.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/script/update-download-data.rb b/script/update-download-data.rb index a7821b663e..6398859409 100644 --- a/script/update-download-data.rb +++ b/script/update-download-data.rb @@ -15,7 +15,7 @@ class DownloadData # name, version, url & date with Feedzirra SOURCEFORGE_URL = "https://sourceforge.net/projects/git-osx-installer/rss?limit=20" - GIT_FOR_WINDOWS_REGEX = /^(Portable|)Git-(\d+\.\d+\.\d+(?:\.\d+)?)-(?:.+-)*(32|64)-bit(?:\..*)?\.exe/ + GIT_FOR_WINDOWS_REGEX = /^(Portable|)Git-(\d+\.\d+\.\d+(?:\.\d+)?)-(?:.+-)*(64-bit|arm64)(?:\..*)?\.exe/ GIT_FOR_WINDOWS_NAME_WITH_OWNER = "git-for-windows/git" class << self @@ -26,13 +26,14 @@ def sourceforge_project_download_url(project, filename) def update_download_windows_versions(config) files_from_github(GIT_FOR_WINDOWS_NAME_WITH_OWNER).each do |name, date, url| # Git for Windows uses the following naming system - # [Portable]Git-#.#.#.#[-dev-preview]-32/64-bit[.7z].exe + # [Portable]Git-#.#.#.#[-dev-preview]-64-bit/arm64[.7z].exe match = GIT_FOR_WINDOWS_REGEX.match(name) next unless match portable = match[1] - bitness = match[3] + architecture = match[3] + architecture = "x64" if architecture == "64-bit" # Git for windows sometimes creates extra releases all based off of the same upstream Git version # so we first want to crop versions like 2.16.1.4 to just 2.16.1 @@ -44,9 +45,9 @@ def update_download_windows_versions(config) config["windows_installer"] = {} if config["windows_installer"].nil? win_config = config["windows_installer"] if portable.empty? - key = "installer#{bitness}" + key = "installer_#{architecture}" else - key = "portable#{bitness}" + key = "portable_#{architecture}" end win_config[key] = {} if win_config[key].nil? return if version_compare(version, win_config[key]["version"]) < 0 From 4bac0784ab8132cafaf1beeaa52f9757498eddf3 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 30 Apr 2025 10:57:12 +0200 Subject: [PATCH 2/4] Re-update download data (Git for Windows v2.49.0) Now that the `update-download-data.rb` script records x64/ARM64 data, let's update `hugo.yml` after running this script. Signed-off-by: Johannes Schindelin --- hugo.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hugo.yml b/hugo.yml index 000f86d152..c6a92cc60e 100644 --- a/hugo.yml +++ b/hugo.yml @@ -62,3 +62,23 @@ params: release_date: '2025-03-17' version: 2.49.0 url: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/Git-2.49.0-64-bit.exe + installer_x64: + filename: Git-2.49.0-64-bit.exe + release_date: '2025-03-17' + version: 2.49.0 + url: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/Git-2.49.0-64-bit.exe + installer_arm64: + filename: Git-2.49.0-arm64.exe + release_date: '2025-03-17' + version: 2.49.0 + url: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/Git-2.49.0-arm64.exe + portable_x64: + filename: PortableGit-2.49.0-64-bit.7z.exe + release_date: '2025-03-17' + version: 2.49.0 + url: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-64-bit.7z.exe + portable_arm64: + filename: PortableGit-2.49.0-arm64.7z.exe + release_date: '2025-03-17' + version: 2.49.0 + url: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-arm64.7z.exe From 379429467fdcf73594dd15c00a816c4af3eb7394 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 30 Apr 2025 10:51:07 +0200 Subject: [PATCH 3/4] Windows: Stop referring to 32-bit/64-bit, refer to x64/ARM64 instead As of v2.47.1, Git for Windows provides an ARM64 version, and as of v2.49.0 it stopped providing an i686 version. The preceding commit updated the information in `hugo.yml` to reflect this, and now it is time to use that information to present the download links accordingly. Signed-off-by: Johannes Schindelin --- assets/js/application.js | 47 ++++++++++++++++++++++------------- content/downloads/win.html | 16 ++++++------ layouts/partials/monitor.html | 2 +- 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/assets/js/application.js b/assets/js/application.js index 9701a9b6ce..b198a8b900 100644 --- a/assets/js/application.js +++ b/assets/js/application.js @@ -593,26 +593,39 @@ var Downloads = { return `${ago}, `; }, - adjustFor32BitWindows: function() { - // adjust the auto-link for Windows 32-bit setups - const is32BitWindows = window.session.browser.os === 'Windows' - && !navigator.userAgent.match(/WOW64|Win64|x64|x86_64/) - if (!is32BitWindows) return; - - const link = $('#auto-download-link'); - const version = $('#auto-download-version'); - const bitness = $('#auto-download-bitness'); - const date = $('#auto-download-date'); - if (link.length && version.length && bitness.length && date.length) { - bitness.html('32-bit'); - link.attr('href', '{{ .Site.Params.windows_installer.installer32.url }}'); - version.html('{{ .Site.Params.windows_installer.installer32.version }}'); - date.html('{{ .Site.Params.windows_installer.installer32.release_date }}'); - } + adjustForWindowsARM64: function() { + /* + * Windows/ARM64 cannot be reliably detected via the User-Agent string; + * Instead, we use the UAData, but that is not available in all browsers. + * For more details, see + * https://github.com/git-for-windows/git-for-windows.github.io/pull/61 + */ + if (!navigator.userAgentData) return; + + navigator.userAgentData.getHighEntropyValues(['architecture', 'platform', 'bitness']) + .then(function(browser) { + if ( + browser.platform !== 'Windows' + || browser.bitness !== '64' + || browser.architecture !== 'arm' + ) return; + + // adjust the auto-link for Windows/ARM64 setups + const link = $('#auto-download-link'); + const version = $('#auto-download-version'); + const architecture = $('#auto-download-architecture'); + const date = $('#auto-download-date'); + if (link.length && version.length && architecture.length && date.length) { + architecture.html('ARM64'); + link.attr('href', '{{ .Site.Params.windows_installer.installer_arm64.url }}'); + version.html('{{ .Site.Params.windows_installer.installer_arm64.version }}'); + date.html('{{ .Site.Params.windows_installer.installer_arm64.release_date }}'); + } + }) }, postProcessDownloadPage: function() { - Downloads.adjustFor32BitWindows(); + Downloads.adjustForWindowsARM64(); $('#relative-release-date').html(Downloads.postProcessReleaseDate); }, } diff --git a/content/downloads/win.html b/content/downloads/win.html index c9ebfa01b8..46fd4c98b2 100644 --- a/content/downloads/win.html +++ b/content/downloads/win.html @@ -8,26 +8,26 @@

Download for Windows

- Click here to download - the latest ({{< site-param windows_installer.installer64.version >}}) - 64-bit version of Git for Windows. + Click here to download + the latest ({{< site-param windows_installer.installer_x64.version >}}) + x64 version of Git for Windows. This is the most recent maintained build. - It was released on {{< site-param windows_installer.installer64.release_date >}}. + It was released on {{< site-param windows_installer.installer_x64.release_date >}}.

Other Git for Windows downloads

Standalone Installer

- 32-bit Git for Windows Setup. + Git for Windows/x64 Setup.

- 64-bit Git for Windows Setup. + Git for Windows/ARM64 Setup.

Portable ("thumbdrive edition")

- 32-bit Git for Windows Portable. + Git for Windows/x64 Portable.

- 64-bit Git for Windows Portable. + Git for Windows/ARM64 Portable.

Using winget tool

diff --git a/layouts/partials/monitor.html b/layouts/partials/monitor.html index 063da4e6a7..85c0cd892e 100644 --- a/layouts/partials/monitor.html +++ b/layouts/partials/monitor.html @@ -10,7 +10,7 @@

Latest source Release

({{ .Site.Params.latest_release_date }}) - + Download Source Code
From d859fc7c6b7ae21a506ef96c33cf547cbcfba567 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 30 Apr 2025 10:58:57 +0200 Subject: [PATCH 4/4] hugo.yml: remove superseded Git for Windows information The information is now stored by CPU architecture, no longer by bitness. Let's drop the parts that are no longer needed (and wouldn't be updated, anyway). Signed-off-by: Johannes Schindelin --- hugo.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/hugo.yml b/hugo.yml index c6a92cc60e..1964774372 100644 --- a/hugo.yml +++ b/hugo.yml @@ -42,26 +42,6 @@ params: release_date: '2021-08-30' filename: git-2.33.0-intel-universal-mavericks.dmg windows_installer: - portable32: - filename: PortableGit-2.48.1-32-bit.7z.exe - release_date: '2025-02-13' - version: 2.48.1 - url: https://github.com/git-for-windows/git/releases/download/v2.48.1.windows.1/PortableGit-2.48.1-32-bit.7z.exe - portable64: - filename: PortableGit-2.49.0-64-bit.7z.exe - release_date: '2025-03-17' - version: 2.49.0 - url: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-64-bit.7z.exe - installer32: - filename: Git-2.48.1-32-bit.exe - release_date: '2025-02-13' - version: 2.48.1 - url: https://github.com/git-for-windows/git/releases/download/v2.48.1.windows.1/Git-2.48.1-32-bit.exe - installer64: - filename: Git-2.49.0-64-bit.exe - release_date: '2025-03-17' - version: 2.49.0 - url: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/Git-2.49.0-64-bit.exe installer_x64: filename: Git-2.49.0-64-bit.exe release_date: '2025-03-17'