-
Notifications
You must be signed in to change notification settings - Fork 612
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I concur with you: Git-2.31.2-ARM64.exe
sounds good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for all your work on the ARM64 version of Git for Windows!!!
I'd like to ask for just minor changes, and for a rebase on top of my (updated) PR.
git-extra/git-update-git-for-windows
Outdated
@@ -211,7 +211,16 @@ update_git_for_windows () { | |||
test -n "$quiet" && test "x$recently_seen" = "x$latest" && return | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
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/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.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/bin
folder is presentcmd\git.exe update-git-for-windows --gui
from Git Bash