git update-git-for-windows: download ARM64 Git for Windows if applicable#340
Conversation
git-extra/git-update-git-for-windows
Outdated
| if [ -d "/arm64/bin" ] | ||
| then | ||
| version_string="Git for Windows $version (ARM64)" | ||
| filename_for_download="ARM64\.exe" |
There was a problem hiding this comment.
I assumed that you want to call the ARM64 binaries something like Git-2.31.2-ARM64.exe - happy to change if you think there might be a better name though!
There was a problem hiding this comment.
No, I concur with you: Git-2.31.2-ARM64.exe sounds good.
git-extra/git-update-git-for-windows
Outdated
|
|
||
| version=$(git --version | sed "s/git version //") | ||
| echo "Git for Windows $version (${bit}bit)" >&2 | ||
| version_string="Git for Windows $version (${bit}bit)" |
There was a problem hiding this comment.
This should probably be replaced already, too. How about
if test -d /arm64/bin
then
arch_bit=ARM64
else
arch_bit=${bit}-bit
fi
echo "Git for Windows $version ($arch_bit)" >&2
[...]
grep "$arch_bit\.exe" |
[...]
git-extra/git-update-git-for-windows
Outdated
| version_string="Git for Windows $version (${bit}bit)" | ||
| filename_for_download="$bit\-bit\.exe" | ||
|
|
||
| if [ -d "/arm64/bin" ] |
There was a problem hiding this comment.
Technically, the Git wrapper does more: it first verifies that we are running on ARM64. Therefore, we could implement the --is-running-on-ARM64 option in /cmd/git.exe and use that. But that sounds like quite a bit of effort for almost no value in return, so I'm fine with the directory check.
To align with Git's coding style, I would like to use test instead of [, though.
git-extra/git-update-git-for-windows
Outdated
| if [ -d "/arm64/bin" ] | ||
| then | ||
| version_string="Git for Windows $version (ARM64)" | ||
| filename_for_download="ARM64\.exe" |
There was a problem hiding this comment.
No, I concur with you: Git-2.31.2-ARM64.exe sounds good.
If the /arm64/bin folder is present, we assume that the user has the ARM64 version of Git for Windows installed. When a new version is available, we'll then automatically download the ARM64 version. This is similar to the logic in git-wrapper.c in mingw-w64-git (technically, the Git wrapper _also_ tests whether it is running an ARM64 executable, but we cannot do that in a shell script). Signed-off-by: Dennis Ameling <dennis@dennisameling.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
|
I went ahead and made those changes, and merged it. If things do not quite work as expected, we'll just need another PR, eh? 😄 |
|
Thanks for making those changes! Quick test is looking good: Indeed downloads from the right path: https://github.com/dennisameling/git/releases/download/2.31.2.windows.1/Git-2.31.2-ARM64.exe Great! This is really exciting 😊 |
Builds further on #338
Needed for git-for-windows/git#3107
If the
/arm64/binfolder is present, we assume that the user has the ARM64 version of Git for Windows installed. When a new version is available, we'll then automatically download the ARM64 version. This is similar to the logic in git-wrapper.c in mingw-w64-git.Sample release with a fake ARM64 installer (renamed 64-bit installer, just to show that the installer indeed downloads the correct file): https://github.com/dennisameling/git/releases/tag/2.31.2.windows.1
Tested as follows:
/arm64/binfolder is presentcmd\git.exe update-git-for-windows --guifrom Git Bash